| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 request.addEventListener("error", event => | 303 request.addEventListener("error", event => |
| 304 { | 304 { |
| 305 reject(new Error("Unexpected: Failed to load overlay.xul")); | 305 reject(new Error("Unexpected: Failed to load overlay.xul")); |
| 306 }); | 306 }); |
| 307 | 307 |
| 308 request.send(null); | 308 request.send(null); |
| 309 })); | 309 })); |
| 310 | 310 |
| 311 // Wait for filters to load | 311 // Wait for filters to load |
| 312 if (FilterStorage._loading) | 312 if (!FilterStorage.initialized) |
| 313 prerequisites.push(FilterNotifier.once("load")); | 313 prerequisites.push(FilterNotifier.once("load")); |
| 314 | 314 |
| 315 // Wait for session to be restored | 315 // Wait for session to be restored |
| 316 prerequisites.push(new Promise((resolve, reject) => | 316 prerequisites.push(new Promise((resolve, reject) => |
| 317 { | 317 { |
| 318 let window = this.currentWindow; | 318 let window = this.currentWindow; |
| 319 if (!window && "nsISessionStore" in Ci) | 319 if (!window && "nsISessionStore" in Ci) |
| 320 { | 320 { |
| 321 // No application windows yet, the application must be starting up. Wait | 321 // No application windows yet, the application must be starting up. Wait |
| 322 // for session to be restored before initializing our UI. | 322 // for session to be restored before initializing our UI. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // CustomizableUI API. | 490 // CustomizableUI API. |
| 491 this.updateIconState(node.ownerDocument.defaultView, node); | 491 this.updateIconState(node.ownerDocument.defaultView, node); |
| 492 }.bind(this), | 492 }.bind(this), |
| 493 }); | 493 }); |
| 494 onShutdown.add(CustomizableUI.destroyWidget.bind(CustomizableUI, "abp-tool
barbutton")); | 494 onShutdown.add(CustomizableUI.destroyWidget.bind(CustomizableUI, "abp-tool
barbutton")); |
| 495 } | 495 } |
| 496 }, | 496 }, |
| 497 | 497 |
| 498 firstRunActions: function(window) | 498 firstRunActions: function(window) |
| 499 { | 499 { |
| 500 if (this.firstRunDone || !window || FilterStorage._loading) | 500 if (this.firstRunDone || !window || !FilterStorage.initialized) |
| 501 return; | 501 return; |
| 502 | 502 |
| 503 this.firstRunDone = true; | 503 this.firstRunDone = true; |
| 504 | 504 |
| 505 let {addonVersion} = require("info"); | 505 let {addonVersion} = require("info"); |
| 506 let prevVersion = Prefs.currentVersion; | 506 let prevVersion = Prefs.currentVersion; |
| 507 if (prevVersion != addonVersion) | 507 if (prevVersion != addonVersion) |
| 508 { | 508 { |
| 509 Prefs.currentVersion = addonVersion; | 509 Prefs.currentVersion = addonVersion; |
| 510 this.addSubscription(window, prevVersion); | 510 this.addSubscription(window, prevVersion); |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)], | 1888 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)], |
| 1889 ["abp-command-toggleshownotifications", "command", Notification.toggleIgnoreCa
tegory.bind(Notification, "*", null)] | 1889 ["abp-command-toggleshownotifications", "command", Notification.toggleIgnoreCa
tegory.bind(Notification, "*", null)] |
| 1890 ]; | 1890 ]; |
| 1891 | 1891 |
| 1892 onShutdown.add(function() | 1892 onShutdown.add(function() |
| 1893 { | 1893 { |
| 1894 for (let window of UI.applicationWindows) | 1894 for (let window of UI.applicationWindows) |
| 1895 if (UI.isBottombarOpen(window)) | 1895 if (UI.isBottombarOpen(window)) |
| 1896 UI.toggleBottombar(window); | 1896 UI.toggleBottombar(window); |
| 1897 }); | 1897 }); |
| OLD | NEW |