Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/content.js

Issue 4858514686083072: Don't dispatch a "load" event for blocked frames on Safari (Closed)
Patch Set: Created Feb. 25, 2014, 10:04 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/content.js
===================================================================
--- a/safari/ext/content.js
+++ b/safari/ext/content.js
@@ -328,12 +328,15 @@
{
event.preventDefault();
- // Safari doesn't dispatch an "error" or "load" event when preventing an
- // element from loading by cancelling the "beforeload" event. So we have
- // to dispatch it manually. Otherwise element collapsing wouldn't work.
- var evt = document.createEvent("Event");
- evt.initEvent(type == "sub_frame" ? "load" : "error");
- event.target.dispatchEvent(evt);
+ // Safari doesn't dispatch an "error" event when preventing an element
+ // from loading by cancelling the "beforeload" event. So we have to
+ // dispatch it manually. Otherwise element collapsing wouldn't work.
+ if (type != "sub_frame")
+ {
+ var evt = document.createEvent("Event");
+ evt.initEvent("error");
+ event.target.dispatchEvent(evt);
+ }
}
}, true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld