Skip to content

BrowserSync / Gulp - disable saveScrollPosition? #65

Description

@Pixelworlds

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions