简体   繁体   English

在Greasemonkey脚本之间共享数据

[英]Sharing Data Between Greasemonkey Scripts

How can I share a string value between two scripts? 如何在两个脚本之间共享字符串值? I want to set the value in the first script on page one. 我想在第一页的第一个脚本中设置值。 I click a link which loads a second page from a different domain. 我单击一个链接,该链接将从另一个域加载第二页。 I want to read the string from the second script on page two. 我想从第二页的第二个脚本中读取字符串。

If you had both scripts running at the same time, you could create your own MessageEvent 如果您同时运行两个脚本,则可以创建自己的MessageEvent

Otherwise, you will need a single script that runs on both domains. 否则,您将需要在两个域上运行的单个脚本。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM