From 8be1aed04d641210ad5e778e17496ea097a125b5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 3 May 2018 09:55:36 -0400 Subject: [PATCH] guard against future instances of issue fixed in #3721 --- platform/chromium/vapi-client.js | 28 +++++++++++++++++-- platform/chromium/vapi-common.js | 20 ++++++++++++- platform/chromium/vapi-usercss.js | 20 +++++++++++++ platform/chromium/vapi-usercss.pseudo.js | 24 ++++++++++++++-- platform/chromium/vapi-usercss.real.js | 24 ++++++++++++++-- platform/chromium/vapi.js | 24 ++++++++++++---- platform/firefox/vapi-usercss.js | 20 +++++++++++++ platform/webext/vapi-usercss.js | 20 +++++++++++++ src/js/scriptlets/cosmetic-logger.js | 23 ++++++++++++++- src/js/scriptlets/cosmetic-off.js | 22 ++++++++++++++- src/js/scriptlets/cosmetic-on.js | 22 ++++++++++++++- src/js/scriptlets/cosmetic-survey.js | 22 ++++++++++++++- src/js/scriptlets/dom-inspector.js | 22 +++++++++++++-- src/js/scriptlets/element-picker.js | 22 ++++++++++++++- src/js/scriptlets/load-large-media-all.js | 22 +++++++++++++-- .../load-large-media-interactive.js | 22 +++++++++++++-- src/js/scriptlets/subscriber.js | 22 +++++++++++++-- 17 files changed, 353 insertions(+), 26 deletions(-) diff --git a/platform/chromium/vapi-client.js b/platform/chromium/vapi-client.js index 0dfbd0dac..4f596d7ad 100644 --- a/platform/chromium/vapi-client.js +++ b/platform/chromium/vapi-client.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2014-2017 The uBlock Origin authors + Copyright (C) 2014-2018 The uBlock Origin authors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ // https://github.com/chrisaljoudi/uBlock/issues/456 // Skip if already injected. -if ( typeof vAPI === 'object' && !vAPI.clientScript ) { // >>>>>>>> start of HUGE-IF-BLOCK +// >>>>>>>> start of HUGE-IF-BLOCK +if ( typeof vAPI === 'object' && !vAPI.clientScript ) { /******************************************************************************/ /******************************************************************************/ @@ -444,4 +445,25 @@ vAPI.shutdown.add(function() { /******************************************************************************/ /******************************************************************************/ -} // <<<<<<<< end of HUGE-IF-BLOCK +} +// <<<<<<<< end of HUGE-IF-BLOCK + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index 19f465963..d198b74b9 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -212,4 +212,22 @@ vAPI.localStorage = { })(this); -/******************************************************************************/ + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/chromium/vapi-usercss.js b/platform/chromium/vapi-usercss.js index 1a2d73a41..72b9c23c9 100644 --- a/platform/chromium/vapi-usercss.js +++ b/platform/chromium/vapi-usercss.js @@ -32,3 +32,23 @@ if ( typeof vAPI === 'object' ) { vAPI.supportsUserStylesheets = /\bChrom(?:e|ium)\/(?:6[6789]|[789]|1\d\d)/.test(navigator.userAgent); } + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/chromium/vapi-usercss.pseudo.js b/platform/chromium/vapi-usercss.pseudo.js index d23336ef8..106370b6a 100644 --- a/platform/chromium/vapi-usercss.pseudo.js +++ b/platform/chromium/vapi-usercss.pseudo.js @@ -24,8 +24,8 @@ // Packaging this file is optional: it is not necessary to package it if the // platform is known to support user stylesheets. -if ( typeof vAPI === 'object' && vAPI.userStylesheet === undefined ) { // >>>>>>>> start of HUGE-IF-BLOCK +if ( typeof vAPI === 'object' && vAPI.userStylesheet === undefined ) { /******************************************************************************/ /******************************************************************************/ @@ -541,5 +541,25 @@ vAPI.DOMFilterer.prototype = { /******************************************************************************/ /******************************************************************************/ -// <<<<<<<< end of HUGE-IF-BLOCK } +// <<<<<<<< end of HUGE-IF-BLOCK + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/chromium/vapi-usercss.real.js b/platform/chromium/vapi-usercss.real.js index 9703fd9dd..82142204c 100644 --- a/platform/chromium/vapi-usercss.real.js +++ b/platform/chromium/vapi-usercss.real.js @@ -24,8 +24,8 @@ // Packaging this file is optional: it is not necessary to package it if the // platform is known to not support user stylesheets. -if ( typeof vAPI === 'object' && vAPI.supportsUserStylesheets ) { // >>>>>>>> start of HUGE-IF-BLOCK +if ( typeof vAPI === 'object' && vAPI.supportsUserStylesheets ) { /******************************************************************************/ /******************************************************************************/ @@ -239,5 +239,25 @@ vAPI.DOMFilterer.prototype = { /******************************************************************************/ /******************************************************************************/ -// <<<<<<<< end of HUGE-IF-BLOCK } +// <<<<<<<< end of HUGE-IF-BLOCK + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/chromium/vapi.js b/platform/chromium/vapi.js index a025e0402..39a242cd1 100644 --- a/platform/chromium/vapi.js +++ b/platform/chromium/vapi.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2017 The uBlock Origin authors + Copyright (C) 2017-2018 The uBlock Origin authors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,8 +53,22 @@ if ( : { uBO: true }; } -// Set the value of the last expression to undefined to avoid serializing the -// vAPI object when the content script is run using chrome.tabs.executeScript. -void 0; -/******************************************************************************/ + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/firefox/vapi-usercss.js b/platform/firefox/vapi-usercss.js index b3a3ce91e..de4946c7d 100644 --- a/platform/firefox/vapi-usercss.js +++ b/platform/firefox/vapi-usercss.js @@ -26,3 +26,23 @@ if ( typeof vAPI === 'object' ) { vAPI.supportsUserStylesheets = true; } + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/platform/webext/vapi-usercss.js b/platform/webext/vapi-usercss.js index 0f3b4c283..6ec8ebb92 100644 --- a/platform/webext/vapi-usercss.js +++ b/platform/webext/vapi-usercss.js @@ -32,3 +32,23 @@ if ( typeof vAPI === 'object' ) { vAPI.supportsUserStylesheets = /\bChrom(?:e|ium)\/(?:6[6789]|[789]|1\d\d)|\bFirefox\/\d/.test(navigator.userAgent); } + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/cosmetic-logger.js b/src/js/scriptlets/cosmetic-logger.js index a1ea4faa5..611f59132 100644 --- a/src/js/scriptlets/cosmetic-logger.js +++ b/src/js/scriptlets/cosmetic-logger.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -252,3 +252,24 @@ vAPI.domWatcher.addListener(handlers); /******************************************************************************/ })(); + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; + diff --git a/src/js/scriptlets/cosmetic-off.js b/src/js/scriptlets/cosmetic-off.js index a3ab578bc..1b7b2eef7 100644 --- a/src/js/scriptlets/cosmetic-off.js +++ b/src/js/scriptlets/cosmetic-off.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,3 +26,23 @@ if ( typeof vAPI === 'object' && vAPI.domFilterer ) { vAPI.domFilterer.toggle(false); } + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/cosmetic-on.js b/src/js/scriptlets/cosmetic-on.js index c7136a6f9..18c7478ce 100644 --- a/src/js/scriptlets/cosmetic-on.js +++ b/src/js/scriptlets/cosmetic-on.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,3 +26,23 @@ if ( typeof vAPI === 'object' && vAPI.domFilterer ) { vAPI.domFilterer.toggle(true); } + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/cosmetic-survey.js b/src/js/scriptlets/cosmetic-survey.js index c94099dbb..efe1faccb 100644 --- a/src/js/scriptlets/cosmetic-survey.js +++ b/src/js/scriptlets/cosmetic-survey.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,3 +35,23 @@ } ); })(); + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/dom-inspector.js b/src/js/scriptlets/dom-inspector.js index 5b2f4df73..230757e0c 100644 --- a/src/js/scriptlets/dom-inspector.js +++ b/src/js/scriptlets/dom-inspector.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -989,4 +989,22 @@ document.documentElement.appendChild(pickerRoot); })(); -/******************************************************************************/ + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/element-picker.js b/src/js/scriptlets/element-picker.js index fb23c9d5d..7731d9471 100644 --- a/src/js/scriptlets/element-picker.js +++ b/src/js/scriptlets/element-picker.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2014-2017 Raymond Hill + Copyright (C) 2014-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1658,3 +1658,23 @@ document.documentElement.appendChild(pickerRoot); /******************************************************************************/ })(); + + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/load-large-media-all.js b/src/js/scriptlets/load-large-media-all.js index 352f2699d..a6d71734a 100644 --- a/src/js/scriptlets/load-large-media-all.js +++ b/src/js/scriptlets/load-large-media-all.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,4 +67,22 @@ while ( i-- ) { })(); -/******************************************************************************/ + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/load-large-media-interactive.js b/src/js/scriptlets/load-large-media-interactive.js index e8d7ed2f1..7208af5a4 100644 --- a/src/js/scriptlets/load-large-media-interactive.js +++ b/src/js/scriptlets/load-large-media-interactive.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2016 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -221,4 +221,22 @@ vAPI.shutdown.add(function() { })(); -/******************************************************************************/ + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0; diff --git a/src/js/scriptlets/subscriber.js b/src/js/scriptlets/subscriber.js index 3ae0a951a..51784ea13 100644 --- a/src/js/scriptlets/subscriber.js +++ b/src/js/scriptlets/subscriber.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2015-2017 Raymond Hill + Copyright (C) 2015-2018 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -122,4 +122,22 @@ setTimeout(function() { })(); -/******************************************************************************/ + + + + + + + +/******************************************************************************* + + DO NOT: + - Remove the following code + - Add code beyond the following code + Reason: + - https://github.com/gorhill/uBlock/pull/3721 + - uBO never uses the return value from injected content scripts + +**/ + +void 0;