| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 )) | 102 )) |
| 103 { | 103 { |
| 104 event.preventDefault(); | 104 event.preventDefault(); |
| 105 | 105 |
| 106 // Safari doesn't dispatch an "error" event when preventing an element | 106 // Safari doesn't dispatch an "error" event when preventing an element |
| 107 // from loading by cancelling the "beforeload" event. So we have to | 107 // from loading by cancelling the "beforeload" event. So we have to |
| 108 // dispatch it manually. Otherwise element collapsing wouldn't work. | 108 // dispatch it manually. Otherwise element collapsing wouldn't work. |
| 109 if (type != "sub_frame") | 109 if (type != "sub_frame") |
| 110 { | 110 { |
| 111 var evt = document.createEvent("Event"); | 111 var evt = document.createEvent("Event"); |
| 112 evt.initEvent(type == "error"); | 112 evt.initEvent("error"); |
| 113 event.target.dispatchEvent(evt); | 113 event.target.dispatchEvent(evt); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 }, true); | 116 }, true); |
| 117 | 117 |
| 118 | 118 |
| 119 /* Context menus */ | 119 /* Context menus */ |
| 120 | 120 |
| 121 document.addEventListener("contextmenu", function(event) | 121 document.addEventListener("contextmenu", function(event) |
| 122 { | 122 { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 messageProxy.handleResponse(event.message); | 396 messageProxy.handleResponse(event.message); |
| 397 break; | 397 break; |
| 398 case "proxyCallback": | 398 case "proxyCallback": |
| 399 backgroundPageProxy.handleCallback(event.message); | 399 backgroundPageProxy.handleCallback(event.message); |
| 400 break; | 400 break; |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 }); | 404 }); |
| 405 })(); | 405 })(); |
| LEFT | RIGHT |