Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 | 146 |
147 // Safari doesn't dispatch the expected events for elements that have | 147 // Safari doesn't dispatch the expected events for elements that have |
148 // been prevented from loading by having their "beforeload" event | 148 // been prevented from loading by having their "beforeload" event |
149 // cancelled. That is a "load" event for blocked frames, and an "error" | 149 // cancelled. That is a "load" event for blocked frames, and an "error" |
150 // event for other blocked elements. We need to dispatch those events | 150 // event for other blocked elements. We need to dispatch those events |
151 // manually here to avoid breaking element collapsing and pages that | 151 // manually here to avoid breaking element collapsing and pages that |
152 // rely on those events. | 152 // rely on those events. |
153 setTimeout(function() | 153 setTimeout(function() |
154 { | 154 { |
155 var evt = document.createEvent("Event"); | 155 var evt = document.createEvent("Event"); |
156 evt.initEvent(eventName, false, true); | 156 evt.initEvent(eventName, false, false); |
Sebastian Noack
2016/09/16 12:42:52
"load" and "error" event don't bubble. I think "be
Sebastian Noack
2016/09/16 12:48:52
Sorry, got it the wrong way around, the second arg
kzar
2016/09/16 13:00:43
Done.
| |
157 event.target.dispatchEvent(evt); | 157 event.target.dispatchEvent(evt); |
158 }); | 158 }); |
159 } | 159 } |
160 }, true); | 160 }, true); |
161 } | 161 } |
162 | 162 |
163 | 163 |
164 /* Context menus */ | 164 /* Context menus */ |
165 | 165 |
166 document.addEventListener("contextmenu", function(event) | 166 document.addEventListener("contextmenu", function(event) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 }); | 223 }); |
224 | 224 |
225 | 225 |
226 /* Detecting extension reload/disable/uninstall (not supported on Safari) */ | 226 /* Detecting extension reload/disable/uninstall (not supported on Safari) */ |
227 | 227 |
228 ext.onExtensionUnloaded = { | 228 ext.onExtensionUnloaded = { |
229 addListener: function() {}, | 229 addListener: function() {}, |
230 removeListener: function() {} | 230 removeListener: function() {} |
231 }; | 231 }; |
232 })(); | 232 })(); |
LEFT | RIGHT |