插件/扩展有什么额外的功能?

发布于 2024-12-25 05:25:35 字数 1432 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如梦 2025-01-01 05:25:35

网站上的脚本通常是沙盒的,并且其功能受到限制(出于安全考虑)。相比之下,扩展程序可以存在于沙箱之外,并与浏览器和系统进行更多交互。例如,某些扩展可以操纵浏览器历史记录、浏览器首选项、拦截和修改页面、访问剪贴板,甚至在系统上执行任意代码。查看 Chrome 扩展程序权限警告可以让您很好地了解Chrome 扩展程序可以做什么(以及大多数脚本不能做什么)。另请查看扩展程序有权访问的 chrome.* API

Scripts on a website are generally sandboxed and are limited in what they can do (for security). In contrast, extensions can live outside of the sandbox and interact more with the browser and system. For example, some extensions can manipulate browser history, browser preferences, intercept and modify pages, access your clipboard, or even execute arbitrary code on the system. Taking a look at the Chrome extensions permissions warnings can give you a pretty good idea of what Chrome extensions can do (and which most scripts can't). Also check out the chrome.* APIs which extensions have access to.

南七夏 2025-01-01 05:25:35

这取决于浏览器。

例如,在 Firefox 中,扩展程序可以打开文件系统上的文件,向其中写入任意字节,然后将该文件作为可执行文件运行。或者换句话说,它可以做 Firefox 本身(或者更一般地说,运行 Firefox 的用户运行的任何程序)可以做的任何事情。

It depends on the browser.

For example, in Firefox an extension can open a file on your filesystem, write arbitrary bytes to it, then run the file as an executable. Or put another way, it can do anything Firefox itself (or more generally, any program run by the user running Firefox) can do.

醉生梦死 2025-01-01 05:25:35

扩展始终存在,理论上可以在每个站点(或根本不在任何站点)上运行,而页面内的脚本仅存在于该页面内。因此,除非您谈论的是仅针对特定站点的非常特定的功能/脚本,否则插件更“可用”。

An extension is always around and theoretically works on every site (or on no site at all), while a script within a page only exists within that page. So unless you're talking about a VERY specific function/script only for a specific site, addons are more "available".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文