Index: safari/ext/popup.js |
=================================================================== |
--- a/safari/ext/popup.js |
+++ b/safari/ext/popup.js |
@@ -6,25 +6,19 @@ |
// everytime it is shown for a different tab. Also we have to reload the |
// popover when the background page wasn't ready yet, since we have to access |
// the background page in the popover. |
- var backgroundPage = safari.extension.globalPage.contentWindow; |
- var valid = backgroundPage.document.readyState == "complete"; |
- var activeTab = safari.application.activeBrowserWindow.activeTab; |
- var mayResize = true; |
- |
safari.self.addEventListener("popover", function() |
{ |
- if (!valid || activeTab != safari.application.activeBrowserWindow.activeTab) |
- { |
- mayResize = false; |
- document.documentElement.style.display = "none"; |
- document.location.reload(); |
- } |
+ mayResize = false; |
+ document.documentElement.style.display = "none"; |
+ document.location.reload(); |
}); |
// Safari doesn't adjust the size of the popover automatically to the size |
// of its content, like when the ad counter is expanded/collapsed. So we add |
// event listeners to do so. |
+ var mayResize = true; |
+ |
var updateSize = function() |
{ |
if (mayResize) |
@@ -63,12 +57,13 @@ |
// import ext into the javascript context of the popover. This code might fail, |
// when the background page isn't ready yet. So it is important to put it below |
// the reloading code above. |
+ var backgroundPage = safari.extension.globalPage.contentWindow; |
+ |
window.ext = { |
__proto__: backgroundPage.ext, |
closePopup: function() |
{ |
safari.self.hide(); |
- valid = false; |
} |
}; |
window.TabMap = backgroundPage.TabMap; |