简体   繁体   English

有没有办法获取在页面上评估的用户脚本代码?

[英]Is there a way to get userscript code that was evaluated on the page?

I have created userscripts to ease logging in my accounts on some websites, but now I'm concerned: Can a site owner see the code of my userscripts?我已经创建了用户脚本以方便在某些网站上登录我的帐户,但现在我担心:网站所有者可以看到我的用户脚本的代码吗?

I'm using Tampermonkey extension for Edge/Chrome, and "Userscripts" Extension/App for iOS Safari.我正在为 Edge/Chrome 使用 Tampermonkey 扩展,为 iOS Safari 使用“Userscripts”扩展/应用。

Usually, websites don't & can't detect userscripts.通常,网站不会也无法检测到用户脚本。 It all depends on how the userscript code is written and if the website is aware of the such userscript to look for it.这完全取决于用户脚本代码的编写方式以及网站是否知道此类用户脚本来查找它。

You can read the reply in @grant directive and detecting a user script by a page which should explain it further.您可以阅读@grant 指令中的回复并通过页面检测用户脚本,该页面应进一步解释。

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

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