简体   繁体   English

我如何在油脂猴子脚本中访问页面级(本地)javascript变量?

[英]How to I access a page level (local) javascript variable in a greasemonkey script?

I just want my GM script to do a window.alert(foo) where foo is equal to a local javascript variable within the page. 我只希望我的GM脚本执行window.alert(foo),其中foo等于页面中的本地javascript变量。

Ideas? 有想法吗?

alert(unsafeWindow.foo);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在润滑脂猴子中访问本地javascript var - how to access a local javascript var in greasemonkey 用Greasemonkey脚本将javascript变量与另一页的内容进行比较? - Greasemonkey script to compare a javascript variable with another page's content? Greasemonkey - 从用户脚本访问页面窗口 Javascript 变量? - Greasemonkey - access in page window Javascript variable from userscript? 本地文件访问,并将油脂猴子脚本编译为XPI - Local file access and compiling a greasemonkey script to xpi 如何从Greasemonkey脚本“安静地”重新加载页面? - How do I “quietly” reload a page from a Greasemonkey script? 如何在Greasemonkey脚本中包含远程javascript文件? - How do I include a remote javascript file in a Greasemonkey script? 如何使用Greasemonkey更改JavaScript变量? - How can I change a JavaScript variable using Greasemonkey? 在Greasemonkey / javascript中,如何处理添加到页面的新元素? - In Greasemonkey/javascript, how can I handle new elements added to page? 使用jQuery的Greasemonkey,如何编写隔油纸脚本来修改页面DOM元素? - Greasemonkey with jQuery, how to write the greasemonkey script to modify page DOM elements? javascript(greasemonkey)如何访问新创建的iframe - javascript (greasemonkey) how to access a newly created iframe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM