diff --git a/src/drivers/webextension/js/content.js b/src/drivers/webextension/js/content.js index 061830705..be07c97c0 100644 --- a/src/drivers/webextension/js/content.js +++ b/src/drivers/webextension/js/content.js @@ -27,7 +27,7 @@ if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) { script.onload = () => { const onMessage = event => { - if ( event.data.id !== 'js' ) { + if (event.data.id !== 'js') { return; } @@ -41,7 +41,7 @@ if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) { addEventListener('message', onMessage); sendMessage('get_js_patterns', {}, response => { - if ( response ) { + if (response) { postMessage({ id: 'patterns', patterns: response.patterns @@ -59,7 +59,7 @@ if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) { } function sendMessage(id, subject, callback) { - ( chrome || browser ).runtime.sendMessage({ + (chrome || browser).runtime.sendMessage({ id, subject, source: 'content.js' diff --git a/src/drivers/webextension/js/inject.js b/src/drivers/webextension/js/inject.js index 7871cf76b..322c21374 100644 --- a/src/drivers/webextension/js/inject.js +++ b/src/drivers/webextension/js/inject.js @@ -5,10 +5,10 @@ let value = properties.length ? window : null; - for ( let i = 0; i < properties.length; i ++ ) { + for (let i = 0; i < properties.length; i ++) { let property = properties[i]; - if ( value && value.hasOwnProperty(property) ) { + if (value && value.hasOwnProperty(property)) { value = value[property]; } else { value = null; @@ -21,7 +21,7 @@ }; const onMessage = event => { - if ( event.data.id !== 'patterns' ) { + if (event.data.id !== 'patterns') { return; } @@ -31,18 +31,18 @@ const js = {}; - for ( let appName in patterns ) { - if ( patterns.hasOwnProperty(appName) ) { + for (let appName in patterns) { + if (patterns.hasOwnProperty(appName)) { js[appName] = {}; - for ( let chain in patterns[appName] ) { - if ( patterns[appName].hasOwnProperty(chain) ) { + for (let chain in patterns[appName]) { + if (patterns[appName].hasOwnProperty(chain)) { js[appName][chain] = {}; - for ( let index in patterns[appName][chain] ) { + for (let index in patterns[appName][chain]) { const value = detectJs(chain); - if ( value && patterns[appName][chain].hasOwnProperty(index) ) { + if (value && patterns[appName][chain].hasOwnProperty(index)) { js[appName][chain][index] = value; } } diff --git a/src/drivers/webextension/manifest.json b/src/drivers/webextension/manifest.json index 5faa84c71..998b613ec 100644 --- a/src/drivers/webextension/manifest.json +++ b/src/drivers/webextension/manifest.json @@ -46,6 +46,10 @@ "http://*/*", "https://*/*" ], + "exclude_matches": [ + "*.modirum.com/*", + "https://www.alphaecommerce.gr/*" + ], "js": [ "js/iframe.js" ],