0
<iframe id="quraniframe" width="100%" height="1100px" src="https://quran.com/1?locale=fa" frameborder="0"></iframe>

so I have this frame on my main page

in the quran.com has a div with footer class so I want to change those style properties so I found these JavaScript code's but that's no effect

var iframe = document.getElementById("quraniframe");
var elmnt = iframe.contentWindow.document.getElementsByClassName("footer");
Ba2sik
  • 283
  • 4
  • 18
reza er
  • 1
  • 3
  • What are you expecting the code to do? As it is, it simply stores the elements in memory, but doesn't modify anything. – mykaf Jan 21 '22 at 16:23
  • @user1599011 yes i know bot after this code i have error in my explorer conceal – reza er Jan 21 '22 at 16:38
  • this error Uncaught DOMException: Blocked a frame with origin "http://localhost" from accessing a cross-origin frame. – reza er Jan 21 '22 at 16:38
  • You should show the code that's causing the error. But sounds like it's blocking a cross-site scripting, as it should. – mykaf Jan 21 '22 at 16:46
  • @user1599011 tnx bro that's second line of JavaScript code. how can i fix it? – reza er Jan 21 '22 at 17:04
  • I don't think you can modify it since the domains don't match. https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame BTW, not a "bro." – mykaf Jan 21 '22 at 18:03
  • You can't modify content from a third party site in the browser unless that site specifically permits it. – Ouroborus Jan 22 '22 at 08:13

0 Answers0