-
Notifications
You must be signed in to change notification settings - Fork 754
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
Replace document.write
with appendChild
method
#1736
Conversation
As per issue BrowserSync#1600 Chrome browsers throw a violation warning in the console when `document.write` is used for injecting elements. Using the 'appendChild' method to inject the script tag mitigates the violation. Violation reference: https://developers.google.com/web/updates/2016/08/removing-document-write
Any update on this? :) |
Looks like this might just need to have the CI run again? |
Any update on this? |
I can approve but I don't have write access to the repo so it doesn't do anything, merging is still blocked. |
@shakyShane Are you able to review this? |
why is this not getting merged? |
Looks like @shakyShane has merge rights, perhaps they can help. Or at least nudge someone that can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing here. script
should be a const
since it's not being set again.
Or perhaps use var
instead, if support for older browsers is a concern. For example if folks have a mobile device test shelf wired up via BS, using let
or const
could be a breaking change if they have a hard requirement to support older devices.
@shakyShane I think you can close this now. (#2019) |
@JohnGemstone thanks for the original PR, it's all fixed up in the latest version though :) |
As per issue #1600 Chrome browsers throw a violation warning in the console when
document.write
is used for injecting elements.Using the 'appendChild' method to inject the script tag mitigates the violation.
Violation reference:
https://developers.google.com/web/updates/2016/08/removing-document-write