OLD | NEW |
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (!/^subscription\.(updated|removed|disabled)$/.test(action) || value.ur
l != Prefs.subscriptions_antiadblockurl) | 443 if (!/^subscription\.(updated|removed|disabled)$/.test(action) || value.ur
l != Prefs.subscriptions_antiadblockurl) |
444 return; | 444 return; |
445 | 445 |
446 if (action == "subscription.updated") | 446 if (action == "subscription.updated") |
447 addAntiAdblockNotification(value); | 447 addAntiAdblockNotification(value); |
448 else if (action == "subscription.removed" || (action == "subscription.disa
bled" && !value.disabled)) | 448 else if (action == "subscription.removed" || (action == "subscription.disa
bled" && !value.disabled)) |
449 removeAntiAdblockNotification(); | 449 removeAntiAdblockNotification(); |
450 }); | 450 }); |
451 | 451 |
452 var documentCreationObserver = { | 452 var documentCreationObserver = { |
453 observe: function(subject, topic, data) | 453 observe: function(subject, topic, data) |
454 { | 454 { |
455 if (!(subject instanceof Ci.nsIDOMWindow)) | 455 if (!(subject instanceof Ci.nsIDOMWindow)) |
456 return; | 456 return; |
457 | 457 |
458 this._showNextNotification(subject.location.href); | 458 this._showNextNotification(subject.location.href); |
459 }.bind(this) | 459 }.bind(this) |
460 }; | 460 }; |
461 Services.obs.addObserver(documentCreationObserver, "content-document-global-
created", false); | 461 Services.obs.addObserver(documentCreationObserver, "content-document-global-
created", false); |
462 onShutdown.add(function() | 462 onShutdown.add(function() |
463 { | 463 { |
464 Services.obs.removeObserver(documentCreationObserver, "content-document-gl
obal-created", false); | 464 Services.obs.removeObserver(documentCreationObserver, "content-document-gl
obal-created", false); |
465 }); | 465 }); |
466 }, | 466 }, |
467 | 467 |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 if (icon.localName == "statusbarpanel") | 1125 if (icon.localName == "statusbarpanel") |
1126 { | 1126 { |
1127 if (Prefs.defaultstatusbaraction == 0) | 1127 if (Prefs.defaultstatusbaraction == 0) |
1128 icon.setAttribute("popup", icon.getAttribute("context")); | 1128 icon.setAttribute("popup", icon.getAttribute("context")); |
1129 else | 1129 else |
1130 icon.removeAttribute("popup"); | 1130 icon.removeAttribute("popup"); |
1131 } | 1131 } |
1132 else | 1132 else |
1133 { | 1133 { |
1134 if (icon.hasAttribute("context") && Prefs.defaulttoolbaraction == 0) | 1134 if (Prefs.defaulttoolbaraction == 0) |
1135 icon.setAttribute("type", "menu"); | 1135 icon.setAttribute("type", "menu"); |
1136 else | 1136 else |
1137 icon.setAttribute("type", "menu-button"); | 1137 icon.setAttribute("type", "menu-button"); |
1138 } | 1138 } |
1139 | 1139 |
1140 icon.setAttribute("abpstate", state); | 1140 icon.setAttribute("abpstate", state); |
1141 }, | 1141 }, |
1142 | 1142 |
1143 /** | 1143 /** |
1144 * Shows or hides status bar icons in all windows, according to pref. | 1144 * Shows or hides status bar icons in all windows, according to pref. |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], | 1963 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], |
1964 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] | 1964 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] |
1965 ]; | 1965 ]; |
1966 | 1966 |
1967 onShutdown.add(function() | 1967 onShutdown.add(function() |
1968 { | 1968 { |
1969 for (let window in UI.applicationWindows) | 1969 for (let window in UI.applicationWindows) |
1970 if (UI.isBottombarOpen(window)) | 1970 if (UI.isBottombarOpen(window)) |
1971 UI.toggleBottombar(window); | 1971 UI.toggleBottombar(window); |
1972 }); | 1972 }); |
OLD | NEW |