1

Recently I discovered browser-sync. Now the application I want to write requires a kind of google map functionality. I noticed that natively browser-sync only supports "scroll,click and forms". I need to hook into all events or at least when panning/interacting with a map, so that it sync's cross browsers.

I found a blog discussion that concluded to have solved this and links to browser-sync-client project https://github.com/BrowserSync/browser-sync-client

Since there is no documentation and only a small example. Can anyone tell me how to implement it within a gulp setup?

I tried to do the following but wihtout any luck:


    var browserSync = require('browser-sync').create(),
    client = require("browser-sync-client");

    gulp.task('browser-sync', function () {

        browserSync.use(client);

        browserSync.init({
            server: {
                baseDir: "./wwwroot"
            },
            ghostMode: {
                clicks: true,
                forms: true,
                scroll: true
            },
            logLevel: "debug",
            open: true,
            minify: false,
            clientEvents: [
                "scroll",
                "input:text",
                "input:toggles",
                "input:keydown",
                "input:keypress",
                "form:submit",
                "form:reset",
                "click",
                "contenteditable:input",
                "mouseup",
                "mousedown",
                "select:change"
            ],
            ghostMode: {
                clicks: true,
                scroll: true,
                forms: {
                    submit: true,
                    inputs: true,
                    toggles: true,
                    keypress: true,
                    keydown: true,
                    contenteditable: true,
                    change: true
                },
                mouseup: true,
                mousedown: true
            },
            capture: true
        });
    });

James Thor
  • 13
  • 3

0 Answers0