Open Bug 691242 Opened 14 years ago Updated 3 years ago

"ASSERTION: Want to fire DOMNodeRemoved event, but it's not safe" with NoScript

Categories

(Core :: DOM: Events, defect, P5)

x86
All
defect

Tracking

()

People

(Reporter: jdm, Unassigned)

References

()

Details

(Keywords: assertion, reproducible)

Attachments

(1 file)

Attached file Backtrace
STR: 1. install noscript 2. visit forums.whirlpool.net.au From the stacktrace, it looks like we: * add a script element * check the content load policies * one of the policies is a script which ends up removing a node (presumably in the same document or something)
STR addendum: 3. temporarily allow scripts on the page 4. assert
It could be a different document. Doesn't matter. As things stand, content policies modifying any DOM is completely unsafe.... We really need to start calling them async. :(
https://addons.mozilla.org/en-US/firefox/files/browse/133269/file/chrome/noscript.jar/content/noscript/ScriptSurrogate.js#L225 This is the function being called by the noscript content load policy (wait what? is that how policies are supposed to work?).
(In reply to Josh Matthews [:jdm] from comment #3) > https://addons.mozilla.org/en-US/firefox/files/browse/133269/file/chrome/ > noscript.jar/content/noscript/ScriptSurrogate.js#L225 > > This is the function being called by the noscript content load policy (wait > what? is that how policies are supposed to work?). Until there are better hooks (if ever), a content policy callback is the only place for an extension to execute a script instead of a blocked one. I could use a Sandbox and avoid to touch the DOM (I used to and, in fact, the method is still there) but I settled for the DOM-based approach after being severely bitten by memory/performance issues (maybe related to bug 646575?) As a middle-ground, changing https://addons.mozilla.org/en-US/firefox/files/browse/133269/file/chrome/noscript.jar/content/noscript/ScriptSurrogate.js#L176 into this.executeSandbox; switches back to Sandbox-based execution every surrogate triggered by a content policy call (by default, this happens on any allowed webpage which tries to import blocked Google Analytics scripts, for instance).
> Until there are better hooks (if ever) Others have asked for such callbacks; all that's missing is time to implement, fwiw...
FYI, NoScript 2.1.5rc1 has changes to never modify the DOM during content policy callbacks.
See Also: → 1353002
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: