Home / Function/ isSameOriginFrame() — react Function Reference

isSameOriginFrame() — react Function Reference

Architecture documentation for the isSameOriginFrame() function in ReactInputSelection.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  165c8f8a_76d4_7e0b_11af_04ad59dc7f72["isSameOriginFrame()"]
  61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5["ReactInputSelection.js"]
  165c8f8a_76d4_7e0b_11af_04ad59dc7f72 -->|defined in| 61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5
  7330d54b_88aa_2185_79a9_d580cfe8f0ac["getActiveElementDeep()"]
  7330d54b_88aa_2185_79a9_d580cfe8f0ac -->|calls| 165c8f8a_76d4_7e0b_11af_04ad59dc7f72
  style 165c8f8a_76d4_7e0b_11af_04ad59dc7f72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/client/ReactInputSelection.js lines 43–57

function isSameOriginFrame(iframe) {
  try {
    // Accessing the contentDocument of a HTMLIframeElement can cause the browser
    // to throw, e.g. if it has a cross-origin src attribute.
    // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
    // iframe.contentDocument.defaultView;
    // A safety way is to access one of the cross origin properties: Window or Location
    // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl

    return typeof iframe.contentWindow.location.href === 'string';
  } catch (err) {
    return false;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does isSameOriginFrame() do?
isSameOriginFrame() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/ReactInputSelection.js.
Where is isSameOriginFrame() defined?
isSameOriginFrame() is defined in packages/react-dom-bindings/src/client/ReactInputSelection.js at line 43.
What calls isSameOriginFrame()?
isSameOriginFrame() is called by 1 function(s): getActiveElementDeep.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free