◐ Shell
clean mode source ↗

fix: correct cross-window-communication article.md en by front42 · Pull Request #3939 · javascript-tutorial/en.javascript.info

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have a reference to another window (for example, a popup created using window.open() or a window inside an <iframe>), and that window belongs to the same origin, then we have full access to it.

Otherwise, if the window belongs to a different origin, we cannot access its contents such as variables, the DOM, or the document object. The only exception is the location object: we can change it (which allows us to redirect the user), but we cannot read it. This restriction prevents information leaks about the user’s current page or data.