Chrome userscript error: “Unsafe JavaScript attempt to access frame”

前端 未结 2 1088
遇见更好的自我
遇见更好的自我 2020-12-03 16:26
// the iframe of the div I need to access
var iframe = document.getElementsByTagName(\"iframe\")[2];
var innerDoc = iframe.contentDocument || iframe.contentWindow.do         


        
2条回答
  •  鱼传尺愫
    2020-12-03 16:41

    For security reasons your browser won't allow you to access javascript in an iframe from another domain.

    See the top answer here:

    jQuery cross domain iframe scripting

提交回复
热议问题