diff --git a/platform/chromium/vapi-webrequest.js b/platform/chromium/vapi-webrequest.js index 2bb0794..034a1ec 100644 --- a/platform/chromium/vapi-webrequest.js +++ b/platform/chromium/vapi-webrequest.js @@ -71,17 +71,21 @@ const parsedURL = new URL('https://www.example.org/'); vAPI.net.normalizeDetails = function(details) { + let type = details.type; + + // https://github.com/uBlockOrigin/uMatrix-issues/issues/156#issuecomment-494427094 + if ( type === 'main_frame' ) { + details.documentUrl = details.url; + } // Chromium 63+ supports the `initiator` property, which contains // the URL of the origin from which the network request was made. - if ( + else if ( typeof details.initiator === 'string' && details.initiator !== 'null' ) { details.documentUrl = details.initiator; } - let type = details.type; - // https://github.com/gorhill/uBlock/issues/1493 // Chromium 49+/WebExtensions support a new request type: `ping`, // which is fired as a result of using `navigator.sendBeacon`.