Index: lib/appSupport.js |
=================================================================== |
--- a/lib/appSupport.js |
+++ b/lib/appSupport.js |
@@ -22,17 +22,20 @@ |
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
Cu.import("resource://gre/modules/Services.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 = function isKnownWindow(/**Window*/ window) |
+{ |
+ return 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; |
@@ -258,17 +261,19 @@ 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 = function ff_getBrowser(window) { |
+ return 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}); |
}; |
@@ -390,17 +395,19 @@ 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 = function tb_getBrowser(window) { |
+ return 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) |
@@ -677,21 +684,27 @@ switch (application) |
} |
}); |
break; |
} |
case "fennec2": |
{ |
- exports.isKnownWindow = function fmn_isKnownWindow(/**Window*/ window) window.document.documentElement.id == "main-window"; |
+ exports.isKnownWindow = function fmn_isKnownWindow(/**Window*/ window) { |
+ return window.document.documentElement.id == "main-window"; |
+ }; |
- exports.getBrowser = function fmn_getBrowser(window) window.BrowserApp.selectedBrowser; |
+ exports.getBrowser = function fmn_getBrowser(window) { |
+ return window.BrowserApp.selectedBrowser; |
+ }; |
- exports.addTab = function fmn_addTab(window, url, event) window.BrowserApp.addTab(url, {selected: true}); |
+ exports.addTab = function fmn_addTab(window, url, event) { |
+ return 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(); |
}; |