From 85255cf195610b65575a94c29a4458541227e101 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 1 Apr 2017 09:58:10 -0400 Subject: [PATCH] fix https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 --- platform/chromium/vapi-common.js | 15 +++++++++------ platform/firefox/vapi-common.js | 15 ++++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index f857e14..ee62f09 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -1,7 +1,7 @@ /******************************************************************************* - µMatrix - a browser extension to block requests. - Copyright (C) 2014 The µBlock authors + uMatrix - a browser extension to block requests. + Copyright (C) 2014-2017 The uMatrix/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 @@ -21,18 +21,21 @@ // For background page or non-background pages -/* global self */ +'use strict'; /******************************************************************************/ /******************************************************************************/ (function() { -'use strict'; - /******************************************************************************/ -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.uMatrix ) { + self.vAPI = { uMatrix: true }; +} + +var vAPI = self.vAPI; var chrome = self.chrome; /******************************************************************************/ diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index a2dd5c6..d100a28 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -1,7 +1,7 @@ /******************************************************************************* - µBlock - a browser extension to block requests. - Copyright (C) 2014 The µBlock authors + uMatrix - a browser extension to block requests. + Copyright (C) 2014-2017 The uMatrix/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 @@ -23,12 +23,12 @@ // For background page or non-background pages +'use strict'; + /******************************************************************************/ (function() { -'use strict'; - /******************************************************************************/ const {Services} = Components.utils.import( @@ -36,7 +36,12 @@ const {Services} = Components.utils.import( null ); -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.uMatrix ) { + self.vAPI = { uMatrix: true }; +} + +var vAPI = self.vAPI; /******************************************************************************/