You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome and Brave will display a warning in the console:
resize:38 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
Steps to reproduce/test case
Setup browser-sync to either behave as a proxy or a static server
Run browser-sync
Visit the browser-sync webserver
Open the inspector in either Chrome or Brave
Please specify which version of Browsersync, node and npm you're running
Browsersync [ 2.27.5]
Node [16.10.0]
Npm [7.24.0]
It seems to me like using document.write is considered a bad-practice. Based on #1849 (comment) it was argued that it doesn't matter given its only running in development.
It's understandable that it's a non-issue given it's only used in development, but it seems to me like it would be worth fixing to avoid the warning. Subjectively, I feel it sets a better example not using APIs like document.write for devs just getting started and future web devs.
Lastly, I would be willing to write a PR to fix it if a maintainer is onboard with changing it. My instinct would be to use document.createElement and document.body.appendChild APIs instead, open to recommendations if there's a better API. Would you be up for a PR to fix this?
The text was updated successfully, but these errors were encountered:
Issue details
Chrome and Brave will display a warning in the console:
Steps to reproduce/test case
Please specify which version of Browsersync, node and npm you're running
It seems to me like using
document.write
is considered a bad-practice. Based on #1849 (comment) it was argued that it doesn't matter given its only running in development.It's understandable that it's a non-issue given it's only used in development, but it seems to me like it would be worth fixing to avoid the warning. Subjectively, I feel it sets a better example not using APIs like
document.write
for devs just getting started and future web devs.The warning does link to https://developers.google.com/web/updates/2016/08/removing-document-write but that really mostly affects production sites, which is a non-issue here.
Lastly, I would be willing to write a PR to fix it if a maintainer is onboard with changing it. My instinct would be to use
document.createElement
anddocument.body.appendChild
APIs instead, open to recommendations if there's a better API. Would you be up for a PR to fix this?The text was updated successfully, but these errors were encountered: