2014-11-15 19:15:11 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
uBlock Origin - a browser extension to block requests.
|
2018-05-03 15:55:36 +02:00
|
|
|
Copyright (C) 2014-2018 The uBlock Origin authors
|
2014-11-15 19:15:11 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
|
|
|
|
|
|
Home: https://github.com/gorhill/uBlock
|
|
|
|
*/
|
|
|
|
|
2017-10-27 20:22:45 +02:00
|
|
|
// For non-background page
|
2016-01-17 19:30:43 +01:00
|
|
|
|
2016-06-28 01:09:04 +02:00
|
|
|
'use strict';
|
|
|
|
|
2014-11-15 19:15:11 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
|
2017-10-27 20:22:45 +02:00
|
|
|
// https://github.com/chrisaljoudi/uBlock/issues/456
|
|
|
|
// Skip if already injected.
|
2014-11-15 19:15:11 +01:00
|
|
|
|
2018-05-03 15:55:36 +02:00
|
|
|
// >>>>>>>> start of HUGE-IF-BLOCK
|
|
|
|
if ( typeof vAPI === 'object' && !vAPI.clientScript ) {
|
2016-01-03 01:33:32 +01:00
|
|
|
|
|
|
|
/******************************************************************************/
|
2016-06-30 22:10:38 +02:00
|
|
|
/******************************************************************************/
|
2016-07-02 00:20:55 +02:00
|
|
|
|
2017-10-27 20:22:45 +02:00
|
|
|
vAPI.clientScript = true;
|
|
|
|
|
2016-07-10 01:21:46 +02:00
|
|
|
vAPI.randomToken = function() {
|
|
|
|
return String.fromCharCode(Date.now() % 26 + 97) +
|
|
|
|
Math.floor(Math.random() * 982451653 + 982451653).toString(36);
|
|
|
|
};
|
|
|
|
|
|
|
|
vAPI.sessionId = vAPI.randomToken();
|
2016-06-30 22:10:38 +02:00
|
|
|
vAPI.chrome = true;
|
2015-05-17 19:02:56 +02:00
|
|
|
vAPI.setTimeout = vAPI.setTimeout || self.setTimeout.bind(self);
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2016-10-01 18:34:25 +02:00
|
|
|
vAPI.shutdown = {
|
|
|
|
jobs: [],
|
|
|
|
add: function(job) {
|
|
|
|
this.jobs.push(job);
|
|
|
|
},
|
|
|
|
exec: function() {
|
2015-04-08 01:34:22 +02:00
|
|
|
var job;
|
2016-10-01 18:34:25 +02:00
|
|
|
while ( (job = this.jobs.pop()) ) {
|
2015-04-08 01:34:22 +02:00
|
|
|
job();
|
|
|
|
}
|
2016-10-01 18:34:25 +02:00
|
|
|
},
|
|
|
|
remove: function(job) {
|
|
|
|
var pos;
|
|
|
|
while ( (pos = this.jobs.indexOf(job)) !== -1 ) {
|
|
|
|
this.jobs.splice(pos, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2015-04-08 01:34:22 +02:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2015-06-29 16:46:20 +02:00
|
|
|
vAPI.messaging = {
|
|
|
|
port: null,
|
2016-03-06 16:51:06 +01:00
|
|
|
portTimer: null,
|
|
|
|
portTimerDelay: 10000,
|
2017-11-20 14:42:32 +01:00
|
|
|
channels: new Map(),
|
|
|
|
connections: new Map(),
|
|
|
|
pending: new Map(),
|
2015-06-29 16:46:20 +02:00
|
|
|
auxProcessId: 1,
|
2016-03-06 16:51:06 +01:00
|
|
|
shuttingDown: false,
|
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
Connection: function(handler, details) {
|
|
|
|
var messaging = vAPI.messaging;
|
|
|
|
this.messaging = messaging;
|
|
|
|
this.handler = handler;
|
|
|
|
this.id = details.id;
|
|
|
|
this.to = details.to;
|
|
|
|
this.toToken = details.toToken;
|
|
|
|
this.from = details.from;
|
|
|
|
this.fromToken = details.fromToken;
|
|
|
|
this.checkBound = this.check.bind(this);
|
|
|
|
this.checkTimer = undefined;
|
|
|
|
// On Firefox it appears ports are not automatically disconnected when
|
|
|
|
// navigating to another page.
|
|
|
|
if ( messaging.Connection.pagehide !== undefined ) { return; }
|
|
|
|
messaging.Connection.pagehide = function() {
|
|
|
|
for ( var connection of this.connections.values() ) {
|
|
|
|
connection.disconnect();
|
|
|
|
connection.handler(connection.toDetails('connectionBroken'));
|
|
|
|
}
|
|
|
|
}.bind(messaging);
|
|
|
|
window.addEventListener('pagehide', messaging.Connection.pagehide);
|
|
|
|
},
|
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
shutdown: function() {
|
|
|
|
this.shuttingDown = true;
|
|
|
|
this.destroyPort();
|
|
|
|
},
|
2015-06-26 06:08:41 +02:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
disconnectListener: function() {
|
2016-01-17 19:30:43 +01:00
|
|
|
this.port = null;
|
|
|
|
vAPI.shutdown.exec();
|
|
|
|
},
|
2017-11-20 14:42:32 +01:00
|
|
|
disconnectListenerBound: null,
|
2016-01-17 19:30:43 +01:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
messageListener: function(details) {
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( !details ) { return; }
|
2016-03-06 16:51:06 +01:00
|
|
|
|
|
|
|
// Sent to all channels
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( details.broadcast ) {
|
|
|
|
for ( var channelName of this.channels.keys() ) {
|
2016-03-06 16:51:06 +01:00
|
|
|
this.sendToChannelListeners(channelName, details.msg);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Response to specific message previously sent
|
2017-11-20 14:42:32 +01:00
|
|
|
var listener;
|
2016-03-06 16:51:06 +01:00
|
|
|
if ( details.auxProcessId ) {
|
2017-11-20 14:42:32 +01:00
|
|
|
listener = this.pending.get(details.auxProcessId);
|
|
|
|
if ( listener !== undefined ) {
|
|
|
|
this.pending.delete(details.auxProcessId);
|
2016-03-06 16:51:06 +01:00
|
|
|
listener(details.msg);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( details.channelName !== 'vapi' ) { return; }
|
|
|
|
|
|
|
|
// Internal handler
|
|
|
|
var connection;
|
|
|
|
|
|
|
|
switch ( details.msg.what ) {
|
|
|
|
case 'connectionAccepted':
|
|
|
|
case 'connectionBroken':
|
|
|
|
case 'connectionCheck':
|
|
|
|
case 'connectionMessage':
|
|
|
|
case 'connectionRefused':
|
|
|
|
connection = this.connections.get(details.msg.id);
|
|
|
|
if ( connection === undefined ) { return; }
|
|
|
|
connection.receive(details.msg);
|
|
|
|
break;
|
|
|
|
case 'connectionRequested':
|
|
|
|
var listeners = this.channels.get(details.msg.to);
|
|
|
|
if ( listeners === undefined ) { return; }
|
|
|
|
var port = this.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
for ( listener of listeners ) {
|
|
|
|
if ( listener(details.msg) !== true ) { continue; }
|
|
|
|
details.msg.what = 'connectionAccepted';
|
|
|
|
details.msg.toToken = port.name;
|
|
|
|
connection = new this.Connection(listener, details.msg);
|
|
|
|
this.connections.set(connection.id, connection);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( details.msg.what !== 'connectionAccepted' ) {
|
|
|
|
details.msg.what = 'connectionRefused';
|
|
|
|
}
|
|
|
|
port.postMessage(details);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2015-07-07 17:03:26 +02:00
|
|
|
}
|
2015-06-29 16:46:20 +02:00
|
|
|
},
|
2016-03-06 16:51:06 +01:00
|
|
|
messageListenerCallback: null,
|
|
|
|
|
|
|
|
portPoller: function() {
|
|
|
|
this.portTimer = null;
|
2017-10-21 19:43:46 +02:00
|
|
|
if (
|
|
|
|
this.port !== null &&
|
2017-11-20 14:42:32 +01:00
|
|
|
this.channels.size === 0 &&
|
|
|
|
this.connections.size === 0 &&
|
|
|
|
this.pending.size === 0
|
2017-10-21 19:43:46 +02:00
|
|
|
) {
|
|
|
|
return this.destroyPort();
|
2016-03-06 16:51:06 +01:00
|
|
|
}
|
2017-11-20 14:42:32 +01:00
|
|
|
this.portTimer = vAPI.setTimeout(this.portPollerBound, this.portTimerDelay);
|
2017-10-21 19:43:46 +02:00
|
|
|
this.portTimerDelay = Math.min(this.portTimerDelay * 2, 60 * 60 * 1000);
|
2016-03-06 16:51:06 +01:00
|
|
|
},
|
2017-11-20 14:42:32 +01:00
|
|
|
portPollerBound: null,
|
2015-06-26 06:08:41 +02:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
destroyPort: function() {
|
|
|
|
if ( this.portTimer !== null ) {
|
|
|
|
clearTimeout(this.portTimer);
|
|
|
|
this.portTimer = null;
|
|
|
|
}
|
2015-07-07 17:03:26 +02:00
|
|
|
var port = this.port;
|
2016-01-17 19:30:43 +01:00
|
|
|
if ( port !== null ) {
|
|
|
|
port.disconnect();
|
2016-03-06 16:51:06 +01:00
|
|
|
port.onMessage.removeListener(this.messageListenerCallback);
|
2017-11-20 14:42:32 +01:00
|
|
|
port.onDisconnect.removeListener(this.disconnectListenerBound);
|
2016-01-17 19:30:43 +01:00
|
|
|
this.port = null;
|
2015-06-29 16:46:20 +02:00
|
|
|
}
|
2017-11-20 14:42:32 +01:00
|
|
|
this.channels.clear();
|
|
|
|
if ( this.connections.size !== 0 ) {
|
|
|
|
for ( var connection of this.connections.values() ) {
|
|
|
|
connection.receive({ what: 'connectionBroken' });
|
|
|
|
}
|
|
|
|
this.connections.clear();
|
2016-03-06 16:51:06 +01:00
|
|
|
}
|
2015-07-07 17:03:26 +02:00
|
|
|
// service pending callbacks
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( this.pending.size !== 0 ) {
|
|
|
|
var pending = this.pending;
|
|
|
|
this.pending = new Map();
|
|
|
|
for ( var callback of pending.values() ) {
|
2016-03-06 16:51:06 +01:00
|
|
|
if ( typeof callback === 'function' ) {
|
|
|
|
callback(null);
|
2015-07-07 17:03:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-06-29 16:46:20 +02:00
|
|
|
},
|
2015-06-28 23:42:08 +02:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
createPort: function() {
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( this.shuttingDown ) { return null; }
|
2016-03-06 16:51:06 +01:00
|
|
|
if ( this.messageListenerCallback === null ) {
|
|
|
|
this.messageListenerCallback = this.messageListener.bind(this);
|
2017-11-20 14:42:32 +01:00
|
|
|
this.disconnectListenerBound = this.disconnectListener.bind(this);
|
|
|
|
this.portPollerBound = this.portPoller.bind(this);
|
2015-06-29 16:46:20 +02:00
|
|
|
}
|
2016-03-06 16:51:06 +01:00
|
|
|
try {
|
2016-03-15 16:17:56 +01:00
|
|
|
this.port = chrome.runtime.connect({name: vAPI.sessionId}) || null;
|
2016-03-06 16:51:06 +01:00
|
|
|
} catch (ex) {
|
2016-03-15 16:17:56 +01:00
|
|
|
this.port = null;
|
|
|
|
}
|
|
|
|
if ( this.port !== null ) {
|
|
|
|
this.port.onMessage.addListener(this.messageListenerCallback);
|
2017-11-20 14:42:32 +01:00
|
|
|
this.port.onDisconnect.addListener(this.disconnectListenerBound);
|
|
|
|
this.portTimerDelay = 10000;
|
|
|
|
if ( this.portTimer === null ) {
|
|
|
|
this.portTimer = vAPI.setTimeout(
|
|
|
|
this.portPollerBound,
|
|
|
|
this.portTimerDelay
|
|
|
|
);
|
|
|
|
}
|
2015-06-26 06:08:41 +02:00
|
|
|
}
|
2016-03-15 16:17:56 +01:00
|
|
|
return this.port;
|
2016-03-06 16:51:06 +01:00
|
|
|
},
|
2015-06-29 16:46:20 +02:00
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
getPort: function() {
|
2016-03-06 16:51:06 +01:00
|
|
|
return this.port !== null ? this.port : this.createPort();
|
|
|
|
},
|
2015-06-26 06:08:41 +02:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
send: function(channelName, message, callback) {
|
|
|
|
// Too large a gap between the last request and the last response means
|
|
|
|
// the main process is no longer reachable: memory leaks and bad
|
|
|
|
// performance become a risk -- especially for long-lived, dynamic
|
|
|
|
// pages. Guard against this.
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( this.pending.size > 25 ) {
|
2016-03-06 16:51:06 +01:00
|
|
|
vAPI.shutdown.exec();
|
2015-06-26 06:08:41 +02:00
|
|
|
}
|
2017-11-20 14:42:32 +01:00
|
|
|
var port = this.getPort();
|
2016-03-06 16:51:06 +01:00
|
|
|
if ( port === null ) {
|
2017-11-20 14:42:32 +01:00
|
|
|
if ( typeof callback === 'function' ) { callback(); }
|
2015-07-07 17:03:26 +02:00
|
|
|
return;
|
|
|
|
}
|
2016-03-06 16:51:06 +01:00
|
|
|
var auxProcessId;
|
|
|
|
if ( callback ) {
|
|
|
|
auxProcessId = this.auxProcessId++;
|
2017-11-20 14:42:32 +01:00
|
|
|
this.pending.set(auxProcessId, callback);
|
2016-03-06 16:51:06 +01:00
|
|
|
}
|
|
|
|
port.postMessage({
|
|
|
|
channelName: channelName,
|
|
|
|
auxProcessId: auxProcessId,
|
|
|
|
msg: message
|
|
|
|
});
|
|
|
|
},
|
2014-11-15 19:15:11 +01:00
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
connectTo: function(from, to, handler) {
|
|
|
|
var port = this.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
var connection = new this.Connection(handler, {
|
|
|
|
id: from + '-' + to + '-' + vAPI.sessionId,
|
|
|
|
to: to,
|
|
|
|
from: from,
|
|
|
|
fromToken: port.name
|
|
|
|
});
|
|
|
|
this.connections.set(connection.id, connection);
|
|
|
|
port.postMessage({
|
|
|
|
channelName: 'vapi',
|
|
|
|
msg: {
|
|
|
|
what: 'connectionRequested',
|
|
|
|
id: connection.id,
|
|
|
|
from: from,
|
|
|
|
fromToken: port.name,
|
|
|
|
to: to
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return connection.id;
|
2016-03-06 16:51:06 +01:00
|
|
|
},
|
2014-11-15 19:15:11 +01:00
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
disconnectFrom: function(connectionId) {
|
|
|
|
var connection = this.connections.get(connectionId);
|
|
|
|
if ( connection === undefined ) { return; }
|
|
|
|
connection.disconnect();
|
|
|
|
},
|
|
|
|
|
|
|
|
sendTo: function(connectionId, payload) {
|
|
|
|
var connection = this.connections.get(connectionId);
|
|
|
|
if ( connection === undefined ) { return; }
|
|
|
|
connection.send(payload);
|
|
|
|
},
|
|
|
|
|
|
|
|
addChannelListener: function(channelName, listener) {
|
|
|
|
var listeners = this.channels.get(channelName);
|
2016-03-06 16:51:06 +01:00
|
|
|
if ( listeners === undefined ) {
|
2017-11-20 14:42:32 +01:00
|
|
|
this.channels.set(channelName, [ listener ]);
|
|
|
|
} else if ( listeners.indexOf(listener) === -1 ) {
|
|
|
|
listeners.push(listener);
|
2016-03-06 16:51:06 +01:00
|
|
|
}
|
2017-11-20 14:42:32 +01:00
|
|
|
this.getPort();
|
|
|
|
},
|
|
|
|
|
|
|
|
removeChannelListener: function(channelName, listener) {
|
|
|
|
var listeners = this.channels.get(channelName);
|
|
|
|
if ( listeners === undefined ) { return; }
|
|
|
|
var pos = listeners.indexOf(listener);
|
|
|
|
if ( pos === -1 ) { return; }
|
2016-03-06 16:51:06 +01:00
|
|
|
listeners.splice(pos, 1);
|
|
|
|
if ( listeners.length === 0 ) {
|
2017-11-20 14:42:32 +01:00
|
|
|
this.channels.delete(channelName);
|
2016-03-06 16:51:06 +01:00
|
|
|
}
|
|
|
|
},
|
2014-11-15 19:15:11 +01:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
removeAllChannelListeners: function(channelName) {
|
2017-11-20 14:42:32 +01:00
|
|
|
this.channels.delete(channelName);
|
2016-03-06 16:51:06 +01:00
|
|
|
},
|
2015-06-28 23:42:08 +02:00
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
sendToChannelListeners: function(channelName, msg) {
|
2017-11-20 14:42:32 +01:00
|
|
|
var listeners = this.channels.get(channelName);
|
2017-10-21 19:43:46 +02:00
|
|
|
if ( listeners === undefined ) { return; }
|
|
|
|
listeners = listeners.slice(0);
|
2016-03-06 16:51:06 +01:00
|
|
|
var response;
|
2017-10-21 19:43:46 +02:00
|
|
|
for ( var listener of listeners ) {
|
|
|
|
response = listener(msg);
|
|
|
|
if ( response !== undefined ) { break; }
|
2015-06-26 06:08:41 +02:00
|
|
|
}
|
2016-03-06 16:51:06 +01:00
|
|
|
return response;
|
2014-11-15 19:15:11 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
|
2017-11-20 14:42:32 +01:00
|
|
|
vAPI.messaging.Connection.prototype = {
|
|
|
|
toDetails: function(what, payload) {
|
|
|
|
return {
|
|
|
|
what: what,
|
|
|
|
id: this.id,
|
|
|
|
from: this.from,
|
|
|
|
fromToken: this.fromToken,
|
|
|
|
to: this.to,
|
|
|
|
toToken: this.toToken,
|
|
|
|
payload: payload
|
|
|
|
};
|
|
|
|
},
|
|
|
|
disconnect: function() {
|
|
|
|
if ( this.checkTimer !== undefined ) {
|
|
|
|
clearTimeout(this.checkTimer);
|
|
|
|
this.checkTimer = undefined;
|
|
|
|
}
|
|
|
|
this.messaging.connections.delete(this.id);
|
|
|
|
var port = this.messaging.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
port.postMessage({
|
|
|
|
channelName: 'vapi',
|
|
|
|
msg: this.toDetails('connectionBroken')
|
|
|
|
});
|
|
|
|
},
|
|
|
|
checkAsync: function() {
|
|
|
|
if ( this.checkTimer !== undefined ) {
|
|
|
|
clearTimeout(this.checkTimer);
|
|
|
|
}
|
|
|
|
this.checkTimer = vAPI.setTimeout(this.checkBound, 499);
|
|
|
|
},
|
|
|
|
check: function() {
|
|
|
|
this.checkTimer = undefined;
|
|
|
|
if ( this.messaging.connections.has(this.id) === false ) { return; }
|
|
|
|
var port = this.messaging.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
port.postMessage({
|
|
|
|
channelName: 'vapi',
|
|
|
|
msg: this.toDetails('connectionCheck')
|
|
|
|
});
|
|
|
|
this.checkAsync();
|
|
|
|
},
|
|
|
|
receive: function(details) {
|
|
|
|
switch ( details.what ) {
|
|
|
|
case 'connectionAccepted':
|
|
|
|
this.toToken = details.toToken;
|
|
|
|
this.handler(details);
|
|
|
|
this.checkAsync();
|
|
|
|
break;
|
|
|
|
case 'connectionBroken':
|
|
|
|
this.messaging.connections.delete(this.id);
|
|
|
|
this.handler(details);
|
|
|
|
break;
|
|
|
|
case 'connectionMessage':
|
|
|
|
this.handler(details);
|
|
|
|
this.checkAsync();
|
|
|
|
break;
|
|
|
|
case 'connectionCheck':
|
|
|
|
var port = this.messaging.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
if ( this.messaging.connections.has(this.id) ) {
|
|
|
|
this.checkAsync();
|
|
|
|
} else {
|
|
|
|
details.what = 'connectionBroken';
|
|
|
|
port.postMessage({ channelName: 'vapi', msg: details });
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'connectionRefused':
|
|
|
|
this.messaging.connections.delete(this.id);
|
|
|
|
this.handler(details);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
send: function(payload) {
|
|
|
|
var port = this.messaging.getPort();
|
|
|
|
if ( port === null ) { return; }
|
|
|
|
port.postMessage({
|
|
|
|
channelName: 'vapi',
|
|
|
|
msg: this.toDetails('connectionMessage', payload)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2016-03-06 16:51:06 +01:00
|
|
|
vAPI.shutdown.add(function() {
|
|
|
|
vAPI.messaging.shutdown();
|
2017-11-20 14:42:32 +01:00
|
|
|
window.vAPI = undefined;
|
2016-03-06 16:51:06 +01:00
|
|
|
});
|
|
|
|
|
2015-06-29 16:46:20 +02:00
|
|
|
// https://www.youtube.com/watch?v=rT5zCHn0tsg
|
|
|
|
// https://www.youtube.com/watch?v=E-jS4e3zacI
|
|
|
|
|
2015-04-08 12:15:10 +02:00
|
|
|
/******************************************************************************/
|
2016-02-04 00:47:30 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
|
2018-05-03 15:55:36 +02:00
|
|
|
}
|
|
|
|
// <<<<<<<< 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;
|