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

后端 未结 5 538
孤城傲影
孤城傲影 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

    If you want to interact with page JavaScript, you will have to insert a script into a page. (Unless you want to use any of the hacks suggested at this page, of course.) I have cooked up a function to do just that for my own scripts, I will post it here in case anyone wants to use it.

    /*
        @description    This function will insert the given code as a 
    
                                     
                  
提交回复
热议问题