| Index: safari/ext/popup.js |
| =================================================================== |
| new file mode 100644 |
| --- /dev/null |
| +++ b/safari/ext/popup.js |
| @@ -0,0 +1,18 @@ |
| +// Safari will load the popover once, and then show it everytime the icon is |
| +// clicked. While Chrome loads it everytime you click the icon. So in order to |
| +// force the same behavior in Safari, we are going to reload the page of the |
| +// bubble everytime it is shown. |
| +safari.application.addEventListener("popover", function() |
| +{ |
| + document.documentElement.style.display = "none"; |
| + document.location.reload(); |
| +}, true); |
| + |
| +// 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. |
| +with (safari.extension.globalPage.contentWindow) |
| +{ |
| + this.ext = ext; |
| + this.TabMap = TabMap; |
| +} |