Description
The check if an access between two browsing contexts should be reported operation can be called with the accessed
browsing context being null.
Here's an example scenario where this happens:
<!doctype html><script>
window.onload = function() {
let iframe = document.querySelector("iframe")
let iframeWindow = iframe.contentWindow;
iframe.remove();
iframeWindow.foo;
}
</script><iframe></iframe>
After the call to iframe.remove();
above, the iframeWindow
no longer has an associated browsing context. (This happens because the iframe removing steps invokes destroy a child navigable, which ends up severing the link between the iframe's document and its browsing context.
Yet when evaluating iframeWindow.foo
, we end up in 7.2.3.7 [[Get]] ( P, Receiver ) where the following happens:
-
Let W be the value of the [[Window]] internal slot of this.
-
Check if an access between two browsing contexts should be reported, given the current global object's browsing context, W's browsing context, P, and the current settings object.