Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: safari/ext/content.js

Issue 5203459900964864: Issue 492 - Implemented popup blocking for Safari (Closed)
Patch Set: Created May 16, 2014, 9:46 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « safari/ext/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 })();
OLDNEW
« no previous file with comments | « safari/ext/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld