Closed
Bug 1488226
Opened 7 years ago
Closed 5 years ago
Iframe that failed to load doesn't fire load or error events
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
DUPLICATE
of bug 1418975
People
(Reporter: evilpies, Unassigned)
Details
Attachments
(1 file)
|
724 bytes,
text/html
|
Details |
I am not quite sure if this is actually a Firefox bug, but an iframe that fails to load will not trigger a load or error event. In Chrome the load event is always triggered.
This came up with Adblock Plus, because the extension uses the load events to hide the iframe element, if it was blocked.
I wrote a testcase for this that includes a webextension that blocks the iframe request, before I realized that a WebExtension is not necessary to observe this behavior.
https://github.com/evilpie/iframe-block-testcase
| Reporter | ||
Comment 1•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
Attachment #9006018 -
Attachment mime type: text/plain → text/html
| Reporter | ||
Comment 2•7 years ago
|
||
Turns out testing this on bmo actually produces a different behavior, because it uses a strict CSP, and that apparently even generates error events.
Comment 3•7 years ago
|
||
For reference, on Chrome, <iframe> elements always emit a "load" event, regardless whether they succeed to load, or failed for whichever reason.
I'm not sure whether an <iframe> that failed to load should rather emit a "load" or "error" event, since technically if loading the requested URL failed to load, it is loading an error page (or an empty document).
However, if no event is emitted at all it looks like to any JavaScript listening to these events like the <iframe> is still loading, which not only prevents us to hide blocked <iframe> elements in Adblock Plus (giving more space to the actual content), but might also cause problems with websites that rely on an event eventually being triggered.
Comment 4•7 years ago
|
||
Possibly a duplicate of bug 444165.
Updated•7 years ago
|
Priority: -- → P2
| Reporter | ||
Updated•5 years ago
|
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•