hackel
hackel

Reputation: 1280

How can I disconnect a running Browsersync instance?

I often would like to compare a new change with the original. To do this, I open two browser tabs of the same page, make a change, then reload one of the tabs to compare. With Browsersync enabled, this becomes impossible because both tabs automatically reload.

How can I disable Browsersync for a particular tab to prevent this from happening? I'm looking for a way to do this from the Javascript console, not having to stop/reload my watcher.

The Browsersync API has a pause() method, but I can't see a way to access this from an actual running Browsersync instance. There is a window.___browserSync___ object accessible, so there must be some way to achieve this.

Upvotes: 5

Views: 943

Answers (1)

hugo der hungrige
hugo der hungrige

Reputation: 12912

The command should be:

 window.___browserSync___.socket.disconnect();

If the ___browserSync___ object isn't available for some reason from the console try doing this in a fresh tab.

Upvotes: 9

Related Questions