MCPcopy Create free account
hub / github.com/microsoft/SandDance / isSameOriginFrame

Function isSameOriginFrame

docs/external/js/react-dom.development.js:7045–7058  ·  view source on GitHub ↗
(iframe)

Source from the content-addressed store, hash-verified

7043 }
7044
7045 function isSameOriginFrame(iframe) {
7046 try {
7047 // Accessing the contentDocument of a HTMLIframeElement can cause the browser
7048 // to throw, e.g. if it has a cross-origin src attribute.
7049 // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
7050 // iframe.contentDocument.defaultView;
7051 // A safety way is to access one of the cross origin properties: Window or Location
7052 // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
7053 // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
7054 return typeof iframe.contentWindow.location.href === 'string';
7055 } catch (err) {
7056 return false;
7057 }
7058 }
7059
7060 function getActiveElementDeep() {
7061 var win = window;

Callers 1

getActiveElementDeepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected