[Webkit-unassigned] [Bug 235893] Accessing `window.frameElement` should not report error if parent is cross-origin

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 31 23:16:01 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235893

--- Comment #2 from Robert Knight <robertknight at gmail.com> ---
I acknowledge the standard doesn't say anything about what gets logged in the browser console. I found it confusing though that a console error was logged even though no exception occurred and the code triggering the error was not doing something that the specs/MDN docs indicated as being deprecated or bad practice.

The code in question looks something like:

```
if (window.frameElement) {
  // Execute some logic that makes use of information about the iframe
  // containing this document.
} else {
  // Fallback for cross-origin case.
}
```

While looking at this I found we also have some code that triggers the same error but from the other side, using the `iframe.contentDocument` property to test whether an iframe is same-origin.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220201/e6aef1eb/attachment.htm>


More information about the webkit-unassigned mailing list