From 0112e548348ac0ac598dcbea9852477f3c6d61d0 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 1 Apr 2017 09:41:08 -0400 Subject: [PATCH] fix https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 --- platform/chromium/vapi-client.js | 13 +++++++++---- platform/firefox/vapi-client.js | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/platform/chromium/vapi-client.js b/platform/chromium/vapi-client.js index 78396637b..efaffeab4 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-2016 The uBlock Origin authors + Copyright (C) 2014-2017 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 @@ -27,7 +27,7 @@ /******************************************************************************/ -(function(self) { +(function() { /******************************************************************************/ /******************************************************************************/ @@ -56,7 +56,12 @@ if ( /^image\/|^text\/plain/.test(contentType) ) { /******************************************************************************/ -var vAPI = self.vAPI = self.vAPI || {}; +// https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 +if ( !self.vAPI || !self.vAPI.uBO ) { + self.vAPI = { uBO: true }; +} + +var vAPI = self.vAPI; var chrome = self.chrome; // https://github.com/chrisaljoudi/uBlock/issues/456 @@ -520,6 +525,6 @@ vAPI.executionCost.stop('vapi-client.js'); /******************************************************************************/ /******************************************************************************/ -})(this); +})(); /******************************************************************************/ diff --git a/platform/firefox/vapi-client.js b/platform/firefox/vapi-client.js index 90c46334d..f5a761923 100644 --- a/platform/firefox/vapi-client.js +++ b/platform/firefox/vapi-client.js @@ -1,7 +1,7 @@ /******************************************************************************* uBlock Origin - a browser extension to block requests. - Copyright (C) 2014-2016 The uBlock Origin authors + Copyright (C) 2014-2017 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 @@ -29,7 +29,7 @@ /******************************************************************************/ -(function(self) { +(function() { // https://github.com/chrisaljoudi/uBlock/issues/464 if ( document instanceof HTMLDocument === false ) { @@ -45,7 +45,12 @@ if ( document instanceof HTMLDocument === false ) { /******************************************************************************/ -var vAPI = self.vAPI = self.vAPI || {}; +// https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 +if ( !self.vAPI || !self.vAPI.uBO ) { + self.vAPI = { uBO: true }; +} + +var vAPI = self.vAPI; /******************************************************************************/ @@ -537,6 +542,6 @@ vAPI.executionCost.stop('vapi-client.js'); /******************************************************************************/ -})(this); +})(); /******************************************************************************/