Browse Source

jshint

pull/2/head
gorhill 10 years ago
parent
commit
764b1a0b7a
  1. 20
      platform/firefox/vapi-background.js
  2. 8
      platform/firefox/vapi-client.js
  3. 1
      platform/firefox/vapi-common.js

20
platform/firefox/vapi-background.js

@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uMatrix Home: https://github.com/gorhill/uMatrix
*/ */
/* jshint esnext: true, bitwise: false */
/* jshint bitwise: false, boss: true, esnext: true */
/* global self, Components, punycode, µBlock */ /* global self, Components, punycode, µBlock */
// For background page // For background page
@ -747,9 +747,9 @@ vAPI.setIcon = function(tabId, iconId, badge) {
var iconStatus = typeof iconId === 'number'; var iconStatus = typeof iconId === 'number';
// If badge is undefined, then setIcon was called from the TabSelect event // 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 curTabId = vAPI.tabs.getTabId(getTabBrowser(win).selectedTab);
var tb = vAPI.toolbarButton; var tb = vAPI.toolbarButton;
@ -1657,9 +1657,15 @@ vAPI.contextMenu.displayMenuItem = function({target}) {
var ctxMap = vAPI.contextMenu.contextMap; var ctxMap = vAPI.contextMenu.contextMap;
for ( var context of ctx ) { 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; menuitem.hidden = false;
return; return;
} }

8
platform/firefox/vapi-client.js

@ -19,6 +19,7 @@
Home: https://github.com/gorhill/uMatrix Home: https://github.com/gorhill/uMatrix
*/ */
/* jshint boss: true, esnext: true */
/* global addMessageListener, removeMessageListener, sendAsyncMessage */ /* global addMessageListener, removeMessageListener, sendAsyncMessage */
// For non background pages // For non background pages
@ -112,17 +113,16 @@ vAPI.messaging = {
addMessageListener(this.connector); addMessageListener(this.connector);
this.channels['vAPI'] = {};
this.channels['vAPI'].listener = function(msg) {
this.channels.vAPI = {
listener: function(msg) {
if ( msg.cmd === 'injectScript' ) { if ( msg.cmd === 'injectScript' ) {
var details = msg.details; var details = msg.details;
if ( !details.allFrames && window !== window.top ) { if ( !details.allFrames && window !== window.top ) {
return; return;
} }
self.injectScript(details.file); self.injectScript(details.file);
} }
}
}; };
}, },

1
platform/firefox/vapi-common.js

@ -19,6 +19,7 @@
Home: https://github.com/gorhill/uMatrix Home: https://github.com/gorhill/uMatrix
*/ */
/* jshint esnext: true */
/* global sendAsyncMessage */ /* global sendAsyncMessage */
// For background page or non-background pages // For background page or non-background pages

Loading…
Cancel
Save