| OLD | NEW |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 document.removeEventListener("visibilitychange", onVisibilitychange); | 50 document.removeEventListener("visibilitychange", onVisibilitychange); |
| 51 }; | 51 }; |
| 52 document.addEventListener("visibilitychange", onVisibilitychange); | 52 document.addEventListener("visibilitychange", onVisibilitychange); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 /* Web requests */ | 56 /* Web requests */ |
| 57 | 57 |
| 58 document.addEventListener("beforeload", function(event) | 58 document.addEventListener("beforeload", function(event) |
| 59 { | 59 { |
| 60 var url = relativeToAbsoluteUrl(event.url); | 60 var url = resolveURL(event.url); |
| 61 | 61 |
| 62 // we don't block non-HTTP requests anyway, so we can bail out | 62 // we don't block non-HTTP requests anyway, so we can bail out |
| 63 // without asking the background page. This is even necessary | 63 // without asking the background page. This is even necessary |
| 64 // because passing large data (like a photo encoded as data: URL) | 64 // because passing large data (like a photo encoded as data: URL) |
| 65 // to the background page, freezes Safari. | 65 // to the background page, freezes Safari. |
| 66 if (!/^https?:/.test(url)) | 66 if (!/^https?:/.test(url)) |
| 67 return; | 67 return; |
| 68 | 68 |
| 69 var type; | 69 var type; |
| 70 switch(event.target.localName) | 70 switch(event.target.localName) |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 messageProxy.handleResponse(event.message); | 424 messageProxy.handleResponse(event.message); |
| 425 break; | 425 break; |
| 426 case "proxyCallback": | 426 case "proxyCallback": |
| 427 backgroundPageProxy.handleCallback(event.message); | 427 backgroundPageProxy.handleCallback(event.message); |
| 428 break; | 428 break; |
| 429 } | 429 } |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 }); | 432 }); |
| 433 })(); | 433 })(); |
| OLD | NEW |