OLD | NEW |
1 with (safari.extension.globalPage.contentWindow) | 1 with (safari.extension.globalPage.contentWindow) |
2 { | 2 { |
3 this.ext = ext; | 3 this.ext = ext; |
4 this.TabMap = TabMap; | 4 this.TabMap = TabMap; |
5 } | 5 } |
6 | 6 |
7 // Safari will load the popover once, and then show it everytime the icon is | 7 // Safari will load the popover once, and then show it everytime the icon is |
8 // clicked. While Chrome loads it everytime you click the icon. So in order to | 8 // clicked. While Chrome loads it everytime you click the icon. So in order to |
9 // force the same behavior in Safari, we are going to reload the page of the | 9 // force the same behavior in Safari, we are going to reload the page of the |
10 // bubble everytime it is shown. | 10 // bubble everytime it is shown. |
11 safari.application.addEventListener("popover", function() | 11 safari.application.addEventListener("popover", function() |
12 { | 12 { |
13 document.documentElement.style.display = "none"; | 13 document.documentElement.style.display = "none"; |
14 document.location.reload(); | 14 document.location.reload(); |
15 }, true); | 15 }, true); |
| 16 |
| 17 // Safari doesn't hide popovers automatically, when we change the active tab |
| 18 // programmatically, like when the options link is clicked. So we add an event |
| 19 // listener to do so. |
| 20 safari.application.addEventListener("activate", function() |
| 21 { |
| 22 safari.self.hide(); |
| 23 }, true); |
OLD | NEW |