Skip to content

Commit 8be1aed

Browse files
committed
guard against future instances of issue fixed in #3721
1 parent 62fd1fe commit 8be1aed

17 files changed

Lines changed: 353 additions & 26 deletions

platform/chromium/vapi-client.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
uBlock Origin - a browser extension to block requests.
4-
Copyright (C) 2014-2017 The uBlock Origin authors
4+
Copyright (C) 2014-2018 The uBlock Origin authors
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,8 @@
2828
// https://github.com/chrisaljoudi/uBlock/issues/456
2929
// Skip if already injected.
3030

31-
if ( typeof vAPI === 'object' && !vAPI.clientScript ) { // >>>>>>>> start of HUGE-IF-BLOCK
31+
// >>>>>>>> start of HUGE-IF-BLOCK
32+
if ( typeof vAPI === 'object' && !vAPI.clientScript ) {
3233

3334
/******************************************************************************/
3435
/******************************************************************************/
@@ -444,4 +445,25 @@ vAPI.shutdown.add(function() {
444445
/******************************************************************************/
445446
/******************************************************************************/
446447

447-
} // <<<<<<<< end of HUGE-IF-BLOCK
448+
}
449+
// <<<<<<<< end of HUGE-IF-BLOCK
450+
451+
452+
453+
454+
455+
456+
457+
458+
/*******************************************************************************
459+
460+
DO NOT:
461+
- Remove the following code
462+
- Add code beyond the following code
463+
Reason:
464+
- https://github.com/gorhill/uBlock/pull/3721
465+
- uBO never uses the return value from injected content scripts
466+
467+
**/
468+
469+
void 0;

platform/chromium/vapi-common.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,22 @@ vAPI.localStorage = {
212212

213213
})(this);
214214

215-
/******************************************************************************/
215+
216+
217+
218+
219+
220+
221+
222+
/*******************************************************************************
223+
224+
DO NOT:
225+
- Remove the following code
226+
- Add code beyond the following code
227+
Reason:
228+
- https://github.com/gorhill/uBlock/pull/3721
229+
- uBO never uses the return value from injected content scripts
230+
231+
**/
232+
233+
void 0;

platform/chromium/vapi-usercss.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,23 @@ if ( typeof vAPI === 'object' ) {
3232
vAPI.supportsUserStylesheets =
3333
/\bChrom(?:e|ium)\/(?:6[6789]|[789]|1\d\d)/.test(navigator.userAgent);
3434
}
35+
36+
37+
38+
39+
40+
41+
42+
43+
/*******************************************************************************
44+
45+
DO NOT:
46+
- Remove the following code
47+
- Add code beyond the following code
48+
Reason:
49+
- https://github.com/gorhill/uBlock/pull/3721
50+
- uBO never uses the return value from injected content scripts
51+
52+
**/
53+
54+
void 0;

platform/chromium/vapi-usercss.pseudo.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
// Packaging this file is optional: it is not necessary to package it if the
2525
// platform is known to support user stylesheets.
2626

27-
if ( typeof vAPI === 'object' && vAPI.userStylesheet === undefined ) {
2827
// >>>>>>>> start of HUGE-IF-BLOCK
28+
if ( typeof vAPI === 'object' && vAPI.userStylesheet === undefined ) {
2929

3030
/******************************************************************************/
3131
/******************************************************************************/
@@ -541,5 +541,25 @@ vAPI.DOMFilterer.prototype = {
541541
/******************************************************************************/
542542
/******************************************************************************/
543543

544-
// <<<<<<<< end of HUGE-IF-BLOCK
545544
}
545+
// <<<<<<<< end of HUGE-IF-BLOCK
546+
547+
548+
549+
550+
551+
552+
553+
554+
/*******************************************************************************
555+
556+
DO NOT:
557+
- Remove the following code
558+
- Add code beyond the following code
559+
Reason:
560+
- https://github.com/gorhill/uBlock/pull/3721
561+
- uBO never uses the return value from injected content scripts
562+
563+
**/
564+
565+
void 0;

platform/chromium/vapi-usercss.real.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
// Packaging this file is optional: it is not necessary to package it if the
2525
// platform is known to not support user stylesheets.
2626

27-
if ( typeof vAPI === 'object' && vAPI.supportsUserStylesheets ) {
2827
// >>>>>>>> start of HUGE-IF-BLOCK
28+
if ( typeof vAPI === 'object' && vAPI.supportsUserStylesheets ) {
2929

3030
/******************************************************************************/
3131
/******************************************************************************/
@@ -239,5 +239,25 @@ vAPI.DOMFilterer.prototype = {
239239
/******************************************************************************/
240240
/******************************************************************************/
241241

242-
// <<<<<<<< end of HUGE-IF-BLOCK
243242
}
243+
// <<<<<<<< end of HUGE-IF-BLOCK
244+
245+
246+
247+
248+
249+
250+
251+
252+
/*******************************************************************************
253+
254+
DO NOT:
255+
- Remove the following code
256+
- Add code beyond the following code
257+
Reason:
258+
- https://github.com/gorhill/uBlock/pull/3721
259+
- uBO never uses the return value from injected content scripts
260+
261+
**/
262+
263+
void 0;

platform/chromium/vapi.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
uBlock Origin - a browser extension to block requests.
4-
Copyright (C) 2017 The uBlock Origin authors
4+
Copyright (C) 2017-2018 The uBlock Origin authors
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -53,8 +53,22 @@ if (
5353
: { uBO: true };
5454
}
5555

56-
// Set the value of the last expression to undefined to avoid serializing the
57-
// vAPI object when the content script is run using chrome.tabs.executeScript.
58-
void 0;
5956

60-
/******************************************************************************/
57+
58+
59+
60+
61+
62+
63+
/*******************************************************************************
64+
65+
DO NOT:
66+
- Remove the following code
67+
- Add code beyond the following code
68+
Reason:
69+
- https://github.com/gorhill/uBlock/pull/3721
70+
- uBO never uses the return value from injected content scripts
71+
72+
**/
73+
74+
void 0;

platform/firefox/vapi-usercss.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,23 @@
2626
if ( typeof vAPI === 'object' ) {
2727
vAPI.supportsUserStylesheets = true;
2828
}
29+
30+
31+
32+
33+
34+
35+
36+
37+
/*******************************************************************************
38+
39+
DO NOT:
40+
- Remove the following code
41+
- Add code beyond the following code
42+
Reason:
43+
- https://github.com/gorhill/uBlock/pull/3721
44+
- uBO never uses the return value from injected content scripts
45+
46+
**/
47+
48+
void 0;

platform/webext/vapi-usercss.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,23 @@ if ( typeof vAPI === 'object' ) {
3232
vAPI.supportsUserStylesheets =
3333
/\bChrom(?:e|ium)\/(?:6[6789]|[789]|1\d\d)|\bFirefox\/\d/.test(navigator.userAgent);
3434
}
35+
36+
37+
38+
39+
40+
41+
42+
43+
/*******************************************************************************
44+
45+
DO NOT:
46+
- Remove the following code
47+
- Add code beyond the following code
48+
Reason:
49+
- https://github.com/gorhill/uBlock/pull/3721
50+
- uBO never uses the return value from injected content scripts
51+
52+
**/
53+
54+
void 0;

src/js/scriptlets/cosmetic-logger.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
uBlock Origin - a browser extension to block requests.
4-
Copyright (C) 2015-2017 Raymond Hill
4+
Copyright (C) 2015-2018 Raymond Hill
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -252,3 +252,24 @@ vAPI.domWatcher.addListener(handlers);
252252
/******************************************************************************/
253253

254254
})();
255+
256+
257+
258+
259+
260+
261+
262+
263+
/*******************************************************************************
264+
265+
DO NOT:
266+
- Remove the following code
267+
- Add code beyond the following code
268+
Reason:
269+
- https://github.com/gorhill/uBlock/pull/3721
270+
- uBO never uses the return value from injected content scripts
271+
272+
**/
273+
274+
void 0;
275+

src/js/scriptlets/cosmetic-off.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
uBlock Origin - a browser extension to block requests.
4-
Copyright (C) 2015-2017 Raymond Hill
4+
Copyright (C) 2015-2018 Raymond Hill
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -26,3 +26,23 @@
2626
if ( typeof vAPI === 'object' && vAPI.domFilterer ) {
2727
vAPI.domFilterer.toggle(false);
2828
}
29+
30+
31+
32+
33+
34+
35+
36+
37+
/*******************************************************************************
38+
39+
DO NOT:
40+
- Remove the following code
41+
- Add code beyond the following code
42+
Reason:
43+
- https://github.com/gorhill/uBlock/pull/3721
44+
- uBO never uses the return value from injected content scripts
45+
46+
**/
47+
48+
void 0;

0 commit comments

Comments
 (0)