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); |