shakyShane / browser-sync-spa

Better Single Page App support for BrowserSync
29 stars 15 forks source link

Disable State-change Syncing #4

Closed bruceCzK closed 8 years ago

bruceCzK commented 9 years ago

Is there a way to disable state-change syncing? It's a little bit annoying while testing. Thanks a lot.

intellix commented 9 years ago

Aye, would also like this. I'm pretty much wanting to disable all the syncing stuff. It just doesn't quite work so ends up being a massive annoyance if you have the site open multiple times.

For instance, if you type in a form on browser A and click submit. Browser B picks up part of it, but doesn't have the same state/scope so doesn't handle it the same way and al sorts of wackiness ensues.

I suppose the whole point of this plugin is to sync state-changes. Might as well just disable this plugin in that case.

bruceCzK commented 8 years ago

In the end I just comment line 18 to 22 in client.js to stop event emit on popstate, seems to work. But hope to have a better way to do it. And sorry for my English.

esetnik commented 8 years ago

+1

fynnfeldpausch commented 8 years ago

+1

shovon commented 8 years ago

For those coming here wanting to also disable the whole mirroring of actions business, take a look at this Stack Overflow answer: http://stackoverflow.com/a/33251486

Quoting the answer directly

Faced same problem, you can simply set ghost mode to false in init options.

AKA:

browserSync.instance = browserSync.init({
  // ...
  ghostMode: false,
  // ...
});