From f5974a500b3f95144c81c5c3c9c1f7f177bea092 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 13 Mar 2019 17:17:37 -0400 Subject: [PATCH] Fix https://github.com/uBlockOrigin/uBlock-issues/issues/459 --- src/js/traffic.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/traffic.js b/src/js/traffic.js index 0ddd3dfc9..1e8c3aa4b 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -283,6 +283,17 @@ const onBeforeBehindTheSceneRequest = function(fctxt) { let result = 0; + // https://github.com/uBlockOrigin/uBlock-issues/issues/459 + // In case of a request for frame, if ever no context is specified assume + // the origin of the context is the same as the request itself. + if ( + fctxt.type === 'sub_frame' && + fctxt.getDocHostname() === 'behind-the-scene' + + ) { + fctxt.setDocOriginFromURL(fctxt.url).setTabOriginFromURL(fctxt.url); + } + // https://github.com/uBlockOrigin/uBlock-issues/issues/339 // Need to also test against `-scheme` since tabOrigin is normalized. // Not especially elegant but for now this accomplishes the purpose of