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 17 matching lines...) Expand all Loading... |
28 var beforeLoadEvent = document.createEvent("Event"); | 28 var beforeLoadEvent = document.createEvent("Event"); |
29 beforeLoadEvent.initEvent("beforeload"); | 29 beforeLoadEvent.initEvent("beforeload"); |
30 | 30 |
31 var isTopLevel = window == window.top; | 31 var isTopLevel = window == window.top; |
32 var isPrerendered = document.visibilityState == "prerender"; | 32 var isPrerendered = document.visibilityState == "prerender"; |
33 | 33 |
34 var documentInfo = safari.self.tab.canLoad( | 34 var documentInfo = safari.self.tab.canLoad( |
35 beforeLoadEvent, | 35 beforeLoadEvent, |
36 { | 36 { |
37 category: "loading", | 37 category: "loading", |
38 url: document.location.href, | 38 url: location.href, |
39 referrer: document.referrer, | 39 referrer: document.referrer, |
40 isTopLevel: isTopLevel, | 40 isTopLevel: isTopLevel, |
41 isPrerendered: isPrerendered | 41 isPrerendered: isPrerendered |
42 } | 42 } |
43 ); | 43 ); |
44 | 44 |
45 if (isTopLevel && isPrerendered) | 45 if (isTopLevel && isPrerendered) |
46 { | 46 { |
47 var onVisibilitychange = function() | 47 var onVisibilitychange = function() |
48 { | 48 { |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 messageProxy.handleResponse(event.message); | 428 messageProxy.handleResponse(event.message); |
429 break; | 429 break; |
430 case "proxyCallback": | 430 case "proxyCallback": |
431 backgroundPageProxy.handleCallback(event.message); | 431 backgroundPageProxy.handleCallback(event.message); |
432 break; | 432 break; |
433 } | 433 } |
434 } | 434 } |
435 } | 435 } |
436 }); | 436 }); |
437 })(); | 437 })(); |
OLD | NEW |