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

Unified Diff: safari/ext/content.js

Issue 29347042: Issue 4199 - Track Safari tabs properly in Content Blocking mode (Closed)
Patch Set: Created June 27, 2016, 3:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/content.js
diff --git a/safari/ext/content.js b/safari/ext/content.js
index 07b89742a8f2d44e52915fb3d794074c50d5feb0..2c43b2dbef79aed4fb2a5458fcceea6fbb13a341 100644
--- a/safari/ext/content.js
+++ b/safari/ext/content.js
@@ -78,22 +78,22 @@
notifyFrameLoading();
});
- if (!usingContentBlockerAPI)
+ // Notify the background page when a prerendered page is displayed. That way
+ // the existing page of the tab can be replaced with this new one.
+ if (isTopLevel && isPrerendered)
{
- // Notify the background page when a prerendered page is displayed. That way
- // the existing page of the tab can be replaced with this new one.
- if (isTopLevel && isPrerendered)
+ var onVisibilitychange = function()
{
- var onVisibilitychange = function()
- {
- safari.self.tab.dispatchMessage("replaced", {documentId: documentId});
- document.removeEventListener("visibilitychange", onVisibilitychange);
- };
- document.addEventListener("visibilitychange", onVisibilitychange);
- }
+ safari.self.tab.dispatchMessage("replaced", {documentId: documentId});
+ document.removeEventListener("visibilitychange", onVisibilitychange);
+ };
+ document.addEventListener("visibilitychange", onVisibilitychange);
+ }
/* Web requests */
+ if (!usingContentBlockerAPI)
+ {
document.addEventListener("beforeload", function(event)
{
// we don't block non-HTTP requests anyway, so we can bail out
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld