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 |