MCPcopy Create free account
hub / github.com/reactjs/react-rails / isSameOriginFrame

Function isSameOriginFrame

lib/assets/react-source/development/react.js:10617–10630  ·  view source on GitHub ↗
(iframe)

Source from the content-addressed store, hash-verified

10615 }
10616
10617 function isSameOriginFrame(iframe) {
10618 try {
10619 // Accessing the contentDocument of a HTMLIframeElement can cause the browser
10620 // to throw, e.g. if it has a cross-origin src attribute.
10621 // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
10622 // iframe.contentDocument.defaultView;
10623 // A safety way is to access one of the cross origin properties: Window or Location
10624 // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
10625 // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
10626 return typeof iframe.contentWindow.location.href === 'string';
10627 } catch (err) {
10628 return false;
10629 }
10630 }
10631
10632 function getActiveElementDeep() {
10633 var win = window;

Callers 1

getActiveElementDeepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected