Skip to content

fix: correct cross-window-communication article.md en#3939

Open
front42 wants to merge 2 commits into
javascript-tutorial:masterfrom
front42:patch-13
Open

fix: correct cross-window-communication article.md en#3939
front42 wants to merge 2 commits into
javascript-tutorial:masterfrom
front42:patch-13

Conversation

@front42
Copy link
Copy Markdown

@front42 front42 commented Feb 22, 2026

Cross-window communication

While editing the ru-version, it turned out that it's more natural in some respects.
It avoids the word tag – DOM entities are involved here,
sometimes it's more accurately stated that we're talking about objects,
the possibility of getting error or null with another origin is indicated, and so on.
But both couldn't avoid confusing newcomers' minds by misunderstanding the terms event and its handler in DOM property
or providing unconfirmed information about short syntax not working, etc.
So let's try to combine the best of each of these versions✅

@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Feb 22, 2026
@javascript-translate-bot javascript-translate-bot requested review from a team February 22, 2026 21:40

The "Same Origin" policy states that:

- if we have a reference to another window, e.g. a popup created by `window.open` or a window inside `<iframe>`, and that window comes from the same origin, then we have full access to that window.
Copy link
Copy Markdown

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.

@javascript-translate-bot javascript-translate-bot added needs +1 One more review needed and removed review needed Review needed, please approve or request changes labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs +1 One more review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants