BrowserSync / gulp-browser-sync

How to use the Browsersync module with gulp.
http://browsersync.io
384 stars 30 forks source link

BrowserSync / Gulp - disable saveScrollPosition? #65

Open Pixelworlds opened 8 years ago

Pixelworlds commented 8 years ago

Does anyone know if there is a method to disable the saveScrollPosition functionality of BrowserSync when using Gulp?

I was looking into the npm modules that brower-sync installs and noticed that the browser-sync-client module has a saveScrollPosition method.

I've also seen several pieces of code that indicate that it might be possible to hook into the browser-sync events to override the saved scroll position like so:

browserSync.on("location:update", function (data) {
    if (data.url && window.location.pathname !== data.url) {
        window.location = data.url;
    } else {
        window.location.reload(true);
    }
});

However, I can't seem to get that to work when running browser-sync via gulp.

Any help would be appreciated!

qrobin commented 7 years ago

+1

ghost commented 6 years ago

+1