Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace document.writewith appendChild method #1931

Closed
wants to merge 2 commits into from

Conversation

DysphoricUnicorn
Copy link

This is an updated PR for #1736 that replaces the usage of let with var.

I did this since the usage of let was criticized in a review on the original PR almost a year ago with no update since.

JohnGemstone and others added 2 commits January 16, 2020 06:59
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
@DysphoricUnicorn
Copy link
Author

DysphoricUnicorn commented Apr 28, 2022

I really don't see how my changes could have caused this CI build to fail.
Could a maintainer maybe retry the build?

I'm always striving to have my apps not output a single error or warning to console and the document.write makes it feel like I didn't achieve that, which can get pretty annoying.

@glen-84
Copy link
Contributor

glen-84 commented Mar 5, 2023

@shakyShane I think you can close this now. (#2019)

@shakyShane
Copy link
Contributor

@DysphoricUnicorn thanks for the original PR - the CI tests failed because in some scenarios Browsersync outputs the snippet to the terminal and I had a test that verifies it's correct :)

All fixed now in the latest version though :)

@shakyShane shakyShane closed this Mar 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants