Skip to content
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

Avoid document write in single script linker loading #9847

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

jhickman
Copy link
Contributor

@jhickman jhickman commented Aug 15, 2023

Not that this is scoped solely with the SingleScriptLinker (<add-linker name="sso" />) and not with the other occurrences of document.write

- replaces PR gwtproject#9814
 - due to currentScript not being fully supported, wrapped in conditional
- fixes issue gwtproject#9797
niloc132 pushed a commit that referenced this pull request Nov 15, 2023
This PR avoids `document.write` in Chrome browser. It cannot be simply
removed for all browsers for reasons mentioned in the code comment (I
verified it's still valid in Firefox, didn't check Safari or IE).

*Motivation*
Same as #9847 -- `document.write`
is considered bad for perfomance (flagged by Lighthouse performance
audits) and completely forbidden in some contexts (chrome extensions,
packaged chrome apps).

*Testing*
This is part of GeoGebra codebase for a few months (via
geogebra/geogebra@ac5c880)
and we didn't notice any problems.

Co-authored-by: Zbynek Konecny <zbynek@geogebra.at>
@niloc132 niloc132 merged commit 84fa2a1 into gwtproject:main Nov 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants