Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 sendMessage: sendMessage, | 79 sendMessage: sendMessage, |
80 browserAction: { | 80 browserAction: { |
81 setIcon: function(path) | 81 setIcon: function(path) |
82 { | 82 { |
83 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path ; | 83 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path ; |
84 }, | 84 }, |
85 setTitle: function(title) | 85 setTitle: function(title) |
86 { | 86 { |
87 safari.extension.toolbarItems[0].toolTip = title; | 87 safari.extension.toolbarItems[0].toolTip = title; |
88 }, | 88 }, |
89 | 89 setBadge: function(badge) |
90 // Safari does not provide these functionalities | 90 { |
91 if (!badge) | |
92 safari.extension.toolbarItems[0].badge = 0; | |
93 else if ("number" in badge) | |
94 safari.extension.toolbarItems[0].badge = badge.number; | |
95 }, | |
96 | |
97 // The following features aren't supported by Safari | |
91 hide: function() {}, | 98 hide: function() {}, |
92 show: function() {}, | 99 show: function() {} |
93 setBadgeBackgroundColor: function(color) {}, | |
94 setBadgeText: function(text) {} | |
Sebastian Noack
2013/11/19 15:27:54
It turned out that Safari actually can show a badg
Thomas Greiner
2013/11/26 17:50:51
Done.
| |
95 } | 100 } |
96 }; | 101 }; |
97 | 102 |
98 TabMap = function() | 103 TabMap = function() |
99 { | 104 { |
100 this._tabs = []; | 105 this._tabs = []; |
101 this._values = []; | 106 this._values = []; |
102 | 107 |
103 this._onClosed = this._onClosed.bind(this); | 108 this._onClosed = this._onClosed.bind(this); |
104 }; | 109 }; |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 // clicked. While Chrome loads it everytime you click the icon. So in order to | 532 // clicked. While Chrome loads it everytime you click the icon. So in order to |
528 // force the same behavior in Safari, we are going to reload the page of the | 533 // force the same behavior in Safari, we are going to reload the page of the |
529 // bubble everytime it is shown. | 534 // bubble everytime it is shown. |
530 if (safari.extension.globalPage.contentWindow != window) | 535 if (safari.extension.globalPage.contentWindow != window) |
531 safari.application.addEventListener("popover", function() | 536 safari.application.addEventListener("popover", function() |
532 { | 537 { |
533 document.documentElement.style.display = "none"; | 538 document.documentElement.style.display = "none"; |
534 document.location.reload(); | 539 document.location.reload(); |
535 }, true); | 540 }, true); |
536 })(); | 541 })(); |
LEFT | RIGHT |