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 20 matching lines...) Expand all Loading... |
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: document.location.href, |
39 referrer: document.referrer, | 39 referrer: document.referrer, |
40 isTopLevel: isTopLevel, | 40 isTopLevel: isTopLevel, |
41 isPrerendered: isPrerendered | 41 isPrerendered: isPrerendered, |
| 42 isPopup: window.opener != null |
42 } | 43 } |
43 ); | 44 ); |
44 | 45 |
45 if (isTopLevel && isPrerendered) | 46 if (isTopLevel && isPrerendered) |
46 { | 47 { |
47 var onVisibilitychange = function() | 48 var onVisibilitychange = function() |
48 { | 49 { |
49 safari.self.tab.dispatchMessage("replaced", {pageId: documentInfo.pageId})
; | 50 safari.self.tab.dispatchMessage("replaced", {pageId: documentInfo.pageId})
; |
50 document.removeEventListener("visibilitychange", onVisibilitychange); | 51 document.removeEventListener("visibilitychange", onVisibilitychange); |
51 }; | 52 }; |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 messageProxy.handleResponse(event.message); | 408 messageProxy.handleResponse(event.message); |
408 break; | 409 break; |
409 case "proxyCallback": | 410 case "proxyCallback": |
410 backgroundPageProxy.handleCallback(event.message); | 411 backgroundPageProxy.handleCallback(event.message); |
411 break; | 412 break; |
412 } | 413 } |
413 } | 414 } |
414 } | 415 } |
415 }); | 416 }); |
416 })(); | 417 })(); |
OLD | NEW |