Index: safari/ext/content.js |
=================================================================== |
--- a/safari/ext/content.js |
+++ b/safari/ext/content.js |
@@ -318,7 +318,16 @@ |
isTopLevel: window == window.top |
} |
})) |
+ { |
event.preventDefault(); |
+ |
+ // 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. |
+ var evt = document.createEvent("Event"); |
+ evt.initEvent(type == "sub_frame" ? "load" : "error"); |
+ event.target.dispatchEvent(evt); |
+ } |
}, true); |