There is a page on the site.
There is a frame on the page, it occupies 100% of the height and width. In fact, we work with the frame, and not with the window in which it is loaded.
Using JS to communicate between the page and the frame from another domain is impossible.
Everything works and the main window to us, in fact, unnecessarily.

But bad luck - you need to perform the function (send a message) in the frame by pressing ENTER.
Naturally, when you try to "press a button" located in the frame from the parent window from another domain, an error appears.

How to be?
In fact, I press Enter while in the frame, but it is still processed by the parent page.

    1 answer 1

    The keyboard is processed by the frame where the keyboard focus is now.

    For example, if you add <textarea> in the frame page, and click in it, then subsequent keystrokes will be processed by this frame, and not by the parent window.

    Here they write about the imitation of a click on the timer to transfer focus, but this does not work for the cross-domain.

    • one
      Your comment helped me. I figured out the problem. The fact is that the page loads a frame, yes. But, in this frame there is a visual editor, which of itself is another frame. So, the function of sending a message is in the first frame, and when you press Enter (at that moment when the cursor is in the input field, that is, in the second frame), processing was performed by window.top.add (). But top does not refer to the parent frame, but to the most important one, I just replaced top with parent (i.e. window.parent.add ();) and everything works :) - hender