1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-29 03:21:09 +12:00
gorhill 2017-04-01 09:39:49 -04:00
parent ad4b9b7b00
commit 9a99a06cd4
2 changed files with 28 additions and 18 deletions

View file

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
µBlock - a browser extension to block requests. uMatrix - a browser extension to block requests.
Copyright (C) 2014 The µBlock authors Copyright (C) 2014-2017 The uMatrix/uBlock Origin authors
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,20 +16,25 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}. along with this program. If not, see {http://www.gnu.org/licenses/}.
Home: https://github.com/gorhill/uBlock Home: https://github.com/gorhill/uMatrix
*/ */
// For non background pages // For non background pages
/******************************************************************************/
(function(self) {
'use strict'; 'use strict';
/******************************************************************************/ /******************************************************************************/
var vAPI = self.vAPI = self.vAPI || {}; (function() {
/******************************************************************************/
// 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; var chrome = self.chrome;
// https://github.com/chrisaljoudi/uBlock/issues/456 // https://github.com/chrisaljoudi/uBlock/issues/456
@ -56,7 +61,7 @@ vAPI.shutdown = (function() {
var exec = function() { var exec = function() {
//console.debug('Shutting down...'); //console.debug('Shutting down...');
var job; var job;
while ( job = jobs.pop() ) { while ( (job = jobs.pop()) ) {
job(); job();
} }
}; };
@ -186,6 +191,6 @@ vAPI.setTimeout = vAPI.setTimeout || function(callback, delay) {
/******************************************************************************/ /******************************************************************************/
})(this); })();
/******************************************************************************/ /******************************************************************************/

View file

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
µBlock - a browser extension to block requests. uMatrix - a browser extension to block requests.
Copyright (C) 2014 The µBlock authors Copyright (C) 2014-2017 The uMatrix/uBlock Origin authors
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -24,15 +24,20 @@
// For non background pages // For non background pages
/******************************************************************************/
(function(self) {
'use strict'; 'use strict';
/******************************************************************************/ /******************************************************************************/
var vAPI = self.vAPI = self.vAPI || {}; (function() {
/******************************************************************************/
// 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;
vAPI.firefox = true; vAPI.firefox = true;
vAPI.sessionId = String.fromCharCode(Date.now() % 25 + 97) + vAPI.sessionId = String.fromCharCode(Date.now() % 25 + 97) +
Math.random().toString(36).slice(2); Math.random().toString(36).slice(2);
@ -206,6 +211,6 @@ if ( window !== window.top ) {
/******************************************************************************/ /******************************************************************************/
})(this); })();
/******************************************************************************/ /******************************************************************************/