Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrowserSync / Gulp - disable saveScrollPosition? #65

Open
Pixelworlds opened this issue Mar 14, 2016 · 2 comments
Open

BrowserSync / Gulp - disable saveScrollPosition? #65

Pixelworlds opened this issue Mar 14, 2016 · 2 comments

Comments

@Pixelworlds
Copy link

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
Copy link

qrobin commented Oct 6, 2016

+1

1 similar comment
@ghost
Copy link

ghost commented Nov 22, 2017

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants