Discussions » Development
如果写一个脚本A (@match https://example.com) ,并想在脚本A中使用 https://example.com/script.js 的某个全局变量的值,这种好像是被greasyfork禁止的,那有其他思路可以实现吗?比如example.com的源码是下面这样的,我想在脚本中直接写window.num获取num的值,但这是被greasyfork禁止的,求正确的写法,谢谢!
<html><head> <script type="text/javascript"> var num = 99; </script> </head> <body>...</body></html>
已解决
Sign in to post a reply.
如果写一个脚本A (@match https://example.com) ,并想在脚本A中使用 https://example.com/script.js 的某个全局变量的值,这种好像是被greasyfork禁止的,那有其他思路可以实现吗?比如example.com的源码是下面这样的,我想在脚本中直接写window.num获取num的值,但这是被greasyfork禁止的,求正确的写法,谢谢!
<html><head> <script type="text/javascript"> var num = 99; </script> </head> <body>...</body></html>