-
Notifications
You must be signed in to change notification settings - Fork 3
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
Override innerHTML throwing console errors #16
Comments
Hi @dave-cunnington, I need to know what scripts you are using in your pages. Overriding native functions is (almost always) a bad idea, but there is no other way to deal with js frameworks that append inline styles to the DOM (and this is why we need to override those functions). This behavior, however, can be disabled with the specific setting in the option page. |
@MocioF I ran into this same issue this week with a Recaptcha V3 script in Chrome. The Recaptcha script updates I was not aware of the setting in the option page you referenced above, so I updated the
This allows non Do you think this is an appropriate solution? I can generate a PR if so. Can you provide more information about how the behavior "can be disabled with the specific setting in the option page"? For further info, this is the link to the Recaptcha script: https://www.gstatic.com/recaptcha/releases/rW64dpMGAGrjU7JJQr9xxPl8/recaptcha__en.js Here is the section of that script that sets the innerhtml:
Elsewhere in that script you can see where it creates the Trusted Types policy, as far as I can tell:
|
After updating to version 1.2.2 we started getting console errors in the overwritten innerHTML code, specifically
replace()
on a null object.no-unsafe-inline-fix…le.js?ver=1.2.2:381 Uncaught (in promise) TypeError: replaced.replace is not a function at HTMLSpanElement.set [as innerHTML] (no-unsafe-inline-fix…js?ver=1.2.2:381:25) at _.nf (main.js:90:236) at _.KE (util.js:67:356) at dM (controls.js:67:410) at new mMa (controls.js:163:804) at nMa (controls.js:67:264) at new TMa (controls.js:165:422) at VMa (controls.js:85:25) at new RNa (controls.js:182:365) at AOa.SNa [as xJ] (controls.js:111:161)
The text was updated successfully, but these errors were encountered: