diff options
author | gorhill <rhill@raymondhill.net> | 2015-08-18 11:44:24 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-08-18 11:44:24 -0400 |
commit | 9b4b998364390290322138b898c255b0b5b2eabf (patch) | |
tree | c8222e675be6c72f239f3d7dc9079306e11fea22 /platform | |
parent | 5366697a0c4a10df5a19b76989f2c95e7bbefc6d (diff) | |
download | uBlock-9b4b998364390290322138b898c255b0b5b2eabf.zip uBlock-9b4b998364390290322138b898c255b0b5b2eabf.tar.gz uBlock-9b4b998364390290322138b898c255b0b5b2eabf.tar.bz2 |
#608: this fixes a bunch of strictness-related warnings
Diffstat (limited to 'platform')
-rw-r--r-- | platform/firefox/frameModule.js | 8 | ||||
-rw-r--r-- | platform/firefox/frameScript.js | 2 | ||||
-rw-r--r-- | platform/firefox/vapi-background.js | 18 | ||||
-rw-r--r-- | platform/firefox/vapi-client.js | 4 |
4 files changed, 21 insertions, 11 deletions
diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index b7c765d..ac2b4ed 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -159,7 +159,8 @@ const contentObserver = { if ( type === this.MAIN_FRAME ) { context = context.contentWindow || context; if ( - context.opener && + typeof context.opener === 'object' && + context.opener !== null && context.opener !== context && this.ignoredPopups.has(context) === false ) { @@ -334,9 +335,8 @@ const contentObserver = { return; } - let win = doc.defaultView; - - if ( !win ) { + let win = doc.defaultView || null; + if ( win === null ) { return; } diff --git a/platform/firefox/frameScript.js b/platform/firefox/frameScript.js index 45d5e1a..fdee50c 100644 --- a/platform/firefox/frameScript.js +++ b/platform/firefox/frameScript.js @@ -19,6 +19,8 @@ Home: https://github.com/gorhill/uBlock */ +/* global addMessageListener, removeMessageListener, docShell */ + /******************************************************************************/ var locationChangeListener; // Keep alive while frameScript is alive diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index aece135..deb7890 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -2707,14 +2707,22 @@ 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; } - - if ( gContextMenu[ctxMap[context]] ) { + if ( + ctxMap.hasOwnProperty(context) && + gContextMenu[ctxMap[context]] + ) { menuitem.hidden = false; return; } diff --git a/platform/firefox/vapi-client.js b/platform/firefox/vapi-client.js index 31c3f67..bd6facd 100644 --- a/platform/firefox/vapi-client.js +++ b/platform/firefox/vapi-client.js @@ -54,7 +54,7 @@ vAPI.shutdown = (function() { var exec = function() { //console.debug('Shutting down...'); var job; - while ( job = jobs.pop() ) { + while ( (job = jobs.pop()) ) { job(); } }; @@ -199,7 +199,7 @@ var messagingConnector = function(details) { var channel; // Sent to all channels - if ( details.broadcast === true && !details.channelName ) { + if ( details.broadcast && !details.channelName ) { for ( channel in channels ) { if ( channels[channel] instanceof MessagingChannel === false ) { continue; |