Closed
Bug 789856
Opened 12 years ago
Closed 12 years ago
script errors not handled when script blocked by a Content Policy
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: tanvi, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
When a Content Policy blocks a script, the error from the script is not handled with an error event that propogates to the client (and is hence displayed to the developer in the Error Console or Web Console).
I discovered this while trying to catch a script load error with the onerror event when a the mixed content Content Policy blocked the script.
I believe the error should be handled in CheckContentPolicy in nsScriptLoader.cpp:
mxr.mozilla.org/mozilla-central/source/content/base/src/nsScriptLoader.cpp#212
Assignee | ||
Comment 1•12 years ago
|
||
So this is basically about us firing onerror on the script if the script is blocked by CheckLoadURI or content policy?
Jonas, any objections? In particular, would this let sites detect when ad-blockers are in use in ways they can't right now?
Comment 2•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #1)
> Jonas, any objections? In particular, would this let sites detect when
> ad-blockers are in use in ways they can't right now?
I doubt that's possible: it's trivial to add a side-effect to a script and check whether that side-effect happened in a later script in the page.
I agree. It will always be possible to detect that a script is blocked, so being explicit about it seems ok.
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #661587 -
Flags: review?(jonas)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment 5•12 years ago
|
||
Comment on attachment 661587 [details] [diff] [review]
Fire error events on <script> elements which completely fail to start the load.
>+ test_bug789856.html \
This file is missing.
Assignee | ||
Updated•12 years ago
|
Attachment #661587 -
Attachment is obsolete: true
Attachment #661587 -
Flags: review?(jonas)
Attachment #661590 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #662316 -
Flags: review?(jonas)
Assignee | ||
Comment 8•12 years ago
|
||
Attachment #662318 -
Flags: review?(jonas)
Assignee | ||
Updated•12 years ago
|
Attachment #661590 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #662316 -
Attachment is obsolete: true
Attachment #662316 -
Flags: review?(jonas)
Attachment #662318 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 9•12 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need review]
Comment 10•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•