diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index bcc0f81..ed8adfa 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -19,7 +19,7 @@ Home: https://github.com/gorhill/uMatrix */ -/* jshint esnext: true, bitwise: false */ +/* jshint bitwise: false, boss: true, esnext: true */ /* global self, Components, punycode, µBlock */ // For background page @@ -747,9 +747,9 @@ vAPI.setIcon = function(tabId, iconId, badge) { var iconStatus = typeof iconId === 'number'; // If badge is undefined, then setIcon was called from the TabSelect event - var win = badge === undefined - ? iconId - : Services.wm.getMostRecentWindow('navigator:browser'); + var win = badge === undefined ? + iconId : + Services.wm.getMostRecentWindow('navigator:browser'); var curTabId = vAPI.tabs.getTabId(getTabBrowser(win).selectedTab); var tb = vAPI.toolbarButton; @@ -1322,7 +1322,7 @@ vAPI.net.registerListeners = function() { var details = e.data; var browser = e.target; var tabId = vAPI.tabs.getTabId(browser); - + //console.debug("nsIWebProgressListener: onLocationChange: " + details.url + " (" + details.flags + ")"); // LOCATION_CHANGE_SAME_DOCUMENT = "did not load a new document" @@ -1657,9 +1657,15 @@ vAPI.contextMenu.displayMenuItem = function({target}) { var ctxMap = vAPI.contextMenu.contextMap; for ( var context of ctx ) { - if ( context === 'page' && !gContextMenu.onLink && !gContextMenu.onImage - && !gContextMenu.onEditableArea && !gContextMenu.inFrame - && !gContextMenu.onVideo && !gContextMenu.onAudio ) { + if ( + context === 'page' && + !gContextMenu.onLink && + !gContextMenu.onImage && + !gContextMenu.onEditableArea && + !gContextMenu.inFrame && + !gContextMenu.onVideo && + !gContextMenu.onAudio + ) { menuitem.hidden = false; return; } diff --git a/platform/firefox/vapi-client.js b/platform/firefox/vapi-client.js index ddc457e..712bb41 100644 --- a/platform/firefox/vapi-client.js +++ b/platform/firefox/vapi-client.js @@ -19,6 +19,7 @@ Home: https://github.com/gorhill/uMatrix */ +/* jshint boss: true, esnext: true */ /* global addMessageListener, removeMessageListener, sendAsyncMessage */ // For non background pages @@ -112,16 +113,15 @@ vAPI.messaging = { addMessageListener(this.connector); - this.channels['vAPI'] = {}; - this.channels['vAPI'].listener = function(msg) { - if ( msg.cmd === 'injectScript' ) { - var details = msg.details; - - if ( !details.allFrames && window !== window.top ) { - return; + this.channels.vAPI = { + listener: function(msg) { + if ( msg.cmd === 'injectScript' ) { + var details = msg.details; + if ( !details.allFrames && window !== window.top ) { + return; + } + self.injectScript(details.file); } - - self.injectScript(details.file); } }; }, @@ -195,7 +195,7 @@ window.addEventListener('pageshow', vAPI.messaging.toggleListener, true); // we are not a top window (because element picker can still // be injected in top window). if ( window !== window.top ) { - // Can anything be done? + // Can anything be done? } /******************************************************************************/ diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index e5cffae..07465dc 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -19,6 +19,7 @@ Home: https://github.com/gorhill/uMatrix */ +/* jshint esnext: true */ /* global sendAsyncMessage */ // For background page or non-background pages