Skip to content

Commit

Permalink
guard against future instances of issue fixed in gorhill#3721
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed May 3, 2018
1 parent 62fd1fe commit 8be1aed
Show file tree
Hide file tree
Showing 17 changed files with 353 additions and 26 deletions.
28 changes: 25 additions & 3 deletions platform/chromium/vapi-client.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ) {

/******************************************************************************/
/******************************************************************************/
Expand Down Expand Up @@ -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;
20 changes: 19 additions & 1 deletion platform/chromium/vapi-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
20 changes: 20 additions & 0 deletions platform/chromium/vapi-usercss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
24 changes: 22 additions & 2 deletions platform/chromium/vapi-usercss.pseudo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

/******************************************************************************/
/******************************************************************************/
Expand Down Expand Up @@ -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;
24 changes: 22 additions & 2 deletions platform/chromium/vapi-usercss.real.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

/******************************************************************************/
/******************************************************************************/
Expand Down Expand Up @@ -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;
24 changes: 19 additions & 5 deletions platform/chromium/vapi.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
20 changes: 20 additions & 0 deletions platform/firefox/vapi-usercss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
20 changes: 20 additions & 0 deletions platform/webext/vapi-usercss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
23 changes: 22 additions & 1 deletion src/js/scriptlets/cosmetic-logger.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

22 changes: 21 additions & 1 deletion src/js/scriptlets/cosmetic-off.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
22 changes: 21 additions & 1 deletion src/js/scriptlets/cosmetic-on.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
22 changes: 21 additions & 1 deletion src/js/scriptlets/cosmetic-survey.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Loading

0 comments on commit 8be1aed

Please sign in to comment.