How can I mimic Greasemonkey/Firefox's unsafeWindow functionality in Chrome?

后端 未结 5 537
孤城傲影
孤城傲影 2020-12-05 16:53

I\'m just fiddling around with user scripts in chrome right now, so please bear with my potential ignorance/idiocy.

In the page I\'m writing a script for, there is a

5条回答
  •  无人及你
    2020-12-05 17:28

    contentWindow was available in Chrome 3, but removed in Chrome 4. Only possible solution for Chrome 4:

    location.href="javascript:(function(){ alert('Hello'); })()"
    

提交回复
热议问题