Cannot disable browser-sync injection into iframe
See original GitHub issueUltimately, I am trying to prevent browser-sync (v2.5.2) from injecting into an iframe with a src of local content.
I’ve tried to disabled it completely with:
gulp.task('browser-sync', function() {
browserSync({
snippetOptions: {
rule: {
match: /xxx/
}
},
server: {
baseDir: [__dirname] + '/_build/',
}
});
});
I’ve also tried ignoring all files:
gulp.task('browser-sync', function() {
browserSync({
snippetOptions: {
ignorePaths: "*.html"
},
server: {
baseDir: [__dirname] + '/_build/',
}
});
});
But these don’t work (also tried blacklist
) and the snippet is injected to both the parent and iframe. Am I missing something?
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cannot disable browser-sync injection into iframe #553 - GitHub
Ultimately, I am trying to prevent browser-sync (v2.5.2) from injecting into an iframe with a src of local content. I've tried to disabled...
Read more >How to blacklist, ignorePaths on iframe content using browser ...
I am using browser-sync to develop ui for a site, and the browser-sync snippet is being injected into an iframe on the page, ......
Read more >Browsersync options
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
Common Mistake #1: Accessing The Scope Through The DOM. There are a few optimization tweaks recommended for production. One of them is disabling...
Read more >Cross-Browser support with Cross-Origin isolation
If you load a document inside an iframe , its context is not considered secure if an ancestor was not served over HTTPS....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @shakyShane. I can confirm this works. I’ve updated my example repo to provide a working version: https://github.com/tomgenoni/browser-sync-block-iframe-example
@tomgenoni - there was an error in your original gulpfile.
snippetOptions
is a separate option, but you had it nested under theserver
property.Either way, in your example, with the latest update (2.7.2), this will work as expected.