browser-sync-webpack-plugin icon indicating copy to clipboard operation
browser-sync-webpack-plugin copied to clipboard

feat: Only trigger a reload if browser sync is not paused

Open jack828 opened this issue 4 years ago • 0 comments

Hi.

Thank you for the plugin. Saved me writing my own one!

I am trying to allow a developer to toggle browser sync, and I would like to use the http protocol api.

With this fix, the plugin correctly checks whether or not browser sync has been paused and prevents triggering a reload.

It's easy to test:

fetch('http://localhost:3215/__browser_sync__?method=pause').then((res)=>console.log(res))
// make some changes...no reload event...
fetch('http://localhost:3215/__browser_sync__?method=resume').then((res)=>console.log(res))
// make some changes...reload event!

jack828 avatar Jun 06 '21 21:06 jack828