Index: lib/appSupport.js |
=================================================================== |
--- a/lib/appSupport.js |
+++ b/lib/appSupport.js |
@@ -23,17 +23,17 @@ Cu.import("resource://gre/modules/XPCOMU |
Cu.import("resource://gre/modules/Services.jsm"); |
Cu.import("resource://gre/modules/AddonManager.jsm"); |
/** |
* Checks whether an application window is known and should get Adblock Plus |
* user interface elements. |
* @result Boolean |
*/ |
-exports.isKnownWindow = function isKnownWindow(/**Window*/ window) false; |
+exports.isKnownWindow = (/**Window*/ window) => false; |
/** |
* HACK: In some applications the window finishes initialization during load |
* event processing which makes an additional delay necessary. This flag |
* indicates that. |
* @type Boolean |
*/ |
exports.delayInitialization = false; |
@@ -259,17 +259,17 @@ switch (application) |
{ |
case "firefox": |
{ |
exports.isKnownWindow = function ff_isKnownWindow(window) |
{ |
return (window.document.documentElement.getAttribute("windowtype") == "navigator:browser"); |
}; |
- exports.getBrowser = function ff_getBrowser(window) window.gBrowser; |
+ exports.getBrowser = (window) => window.gBrowser; |
exports.addTab = function ff_addTab(window, url, event) |
{ |
if (event) |
window.openNewTabWith(url, exports.getBrowser(window).contentDocument, null, event, false); |
else |
window.gBrowser.loadOneTab(url, {inBackground: false}); |
}; |
@@ -391,17 +391,17 @@ switch (application) |
exports.isKnownWindow = function tb_isKnownWindow(window) |
{ |
let type = window.document.documentElement.getAttribute("windowtype"); |
return (type == "mail:3pane" || type == "mail:messageWindow"); |
}; |
exports.delayInitialization = true; |
- exports.getBrowser = function tb_getBrowser(window) window.getBrowser(); |
+ exports.getBrowser = (window) => window.getBrowser(); |
exports.addTab = function tb_addTab(window, url, event) |
{ |
let tabmail = window.document.getElementById("tabmail"); |
if (!tabmail) |
{ |
let wnd = Services.wm.getMostRecentWindow("mail:3pane"); |
if (window) |
@@ -678,21 +678,21 @@ switch (application) |
} |
}); |
break; |
} |
case "fennec2": |
{ |
- exports.isKnownWindow = function fmn_isKnownWindow(/**Window*/ window) window.document.documentElement.id == "main-window"; |
+ exports.isKnownWindow = (window) => window.document.documentElement.id == "main-window"; |
- exports.getBrowser = function fmn_getBrowser(window) window.BrowserApp.selectedBrowser; |
+ exports.getBrowser = (window) => window.BrowserApp.selectedBrowser; |
- exports.addTab = function fmn_addTab(window, url, event) window.BrowserApp.addTab(url, {selected: true}); |
+ exports.addTab = (window, url, event) => window.BrowserApp.addTab(url, {selected: true}); |
let BrowserChangeListener = function(window, callback) |
{ |
this.window = window; |
this.callback = callback; |
this.onSelect = this.onSelect.bind(this); |
this.attach(); |
}; |