From 9bde0c09c312feebe5abc96240214f91aeca198a Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sun, 23 Jun 2019 13:30:04 +0200 Subject: Split vAPI.net --- js/vapi-background.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index a7cc5f3..3035556 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -534,47 +534,6 @@ } }; - vAPI.net = {}; - - vAPI.net.registerListeners = function () { - this.onBeforeRequest.types = this.onBeforeRequest.types - ? new Set(this.onBeforeRequest.types) - : null; - - this.onBeforeSendHeaders.types = this.onBeforeSendHeaders.types - ? new Set(this.onBeforeSendHeaders.types) - : null; - - let shouldLoadListenerMessageName = location.host + ':shouldLoad'; - let shouldLoadListener = function (e) { - let details = e.data; - let pendingReq = httpObserver.createPendingRequest(details.url); - pendingReq.rawType = details.rawType; - pendingReq.tabId = vAPI.tabs.manager.tabIdFromTarget(e.target); - }; - - // https://github.com/gorhill/uMatrix/issues/200 - // We need this only for Firefox 34 and less: the tab id is derived from - // the origin of the message. - if (!vAPI.modernFirefox) { - vAPI.messaging.globalMessageManager - .addMessageListener(shouldLoadListenerMessageName, - shouldLoadListener); - } - - httpObserver.register(); - - vAPI.addCleanUpTask(function () { - if (!vAPI.modernFirefox) { - vAPI.messaging.globalMessageManager - .removeMessageListener(shouldLoadListenerMessageName, - shouldLoadListener); - } - - httpObserver.unregister(); - }); - }; - vAPI.toolbarButton = { id: location.host + '-button', type: 'view', -- cgit v1.2.3