From 0ba8c33a40f1078410de388bdf30ce6dc8a266a5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 30 Mar 2018 15:29:46 -0400 Subject: [PATCH] make use of Chromium 63's webRequest's new property --- platform/chromium/vapi-webrequest.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/chromium/vapi-webrequest.js b/platform/chromium/vapi-webrequest.js index 875404f27..e7f63337d 100644 --- a/platform/chromium/vapi-webrequest.js +++ b/platform/chromium/vapi-webrequest.js @@ -104,7 +104,19 @@ vAPI.net.registerListeners = function() { return ''; }; + var reNetworkURI = /^(?:ftps?|https?|wss?)/; + var normalizeRequestDetails = function(details) { + // Chromium 63+ supports the `initiator` property, which contains + // the URL of the origin from which the network request was made. + if ( + details.tabId === vAPI.noTabId && + reNetworkURI.test(details.initiator) + ) { + details.tabId = vAPI.anyTabId; + details.documentUrl = details.initiator; + } + var type = details.type; // https://github.com/gorhill/uBlock/issues/1493