我有一个非常简单的greasemonkey 脚本,我想调用页面上已有的javascript 函数。我已阅读文档,但似乎没有任何效果
window.setTimeout(function() {
alert('test') // This alert works, but nothing after it does
myFunction() // undefined
window.myFunction() // undefined
document.myFunction() // undefined
}, 1000);
最佳答案
尝试使用: unsafeWindow.myFunction();
更多详细信息和信息 - http://wiki.greasespot.net/UnsafeWindow
关于javascript - 如何让 Greasemonkey 在加载后调用页面上的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/443430/