As of the iframe to prevent access to the parent window?

Huh?
So here are things that were not working
window.parent.document.write("<h1>Text</h1>")

I have this design<iframe srcdoc="' + variable + '"></code> . Can be cut from the variable "parent"? Without a word, you cannot get to the parent? Thank you.</iframe>
July 12th 19 at 16:47
2 answers
July 12th 19 at 16:49
Solution
To influence a parent can only iframe with the same domain. You want to deny yourself?
I have here this design is an iframe srcdoc=" variable" . Can be cut from the variable "parent"? Without a word, you cannot get to the parent? Thank you. - Jefferey commented on July 12th 19 at 16:52
Yes, I have people can create iframe, I want to prevent them from breaking the whole page. - Jefferey commented on July 12th 19 at 16:55
: Place the iframe on a different domain. Everything else that you can think of can be easily bypassed. - raphaelle_Strosin53 commented on July 12th 19 at 16:58
: I have a code people is written in an iframe , so they hulyuganili. I.e. no src = "url" and the srcdoc ="code". I can't make it to another domain. I need the people put the code in your post. - Jefferey commented on July 12th 19 at 17:01
July 12th 19 at 16:51
Any way if the domain is the same, in the iframe, there are no options even close to similar rights assignment.
There is the question srcdoc= code and not src = url.
there is another question: "what words to cut from your code, it was impossible to get to the parent? for example, "parent", "top", "window", "document" - Jefferey commented on July 12th 19 at 16:54
: What words do not cut, this is easily bypassed. In addition these words can be used not only to access the parent window. - Jefferey commented on July 12th 19 at 16:57
: Yes, I understand, will have to send to another domain and pull from there. We'll figure something out. - raphaelle_Strosin53 commented on July 12th 19 at 17:00
digging jsfidle they have something tricky. Just create an iframe without a url and code, and then write to it the html, but I haven't poyal like. From codepen too, so - Jefferey commented on July 12th 19 at 17:03

Find more questions by tags JavaScript