Let me get to the page where my js-скрипт
works (connected via greasemonkey). Using it on the page I create an iframe
element:
var el = document.createElement("iframe"); el.id = "iframe"; el.style.width = "1000px"; el.style.height = "800px"; el.src = HrefLinkOnParentPage; document.body.appendChild(el);
Naturally, there was a problem that the js
namespace matches the parent-страницы
and the child-страницы
. Because of this, frames are recursively created in frames.
Is there any way to determine if the page is child
or parent
? Those. after creating the frame for the first time, you need to determine that it is the frame of the main page and stop the execution of the script on it.