Firefox 扩展和插件有什么区别?

发布于 2024-10-01 05:37:20 字数 111 浏览 4 评论 0原文

Firefox 中有插件和扩展。您能向我解释一下为什么这些插件有不同的名称和选项卡吗?它们的差异如此之大以至于需要不同的名称吗?我认为区分这些东西有点不自然,扩展具有越来越多的功能,与插件相比,它们缺少什么?

In Firefox there are plugins and extensions. Could you please explain to me why these addons have different name and tabs ? Does they differ so much so they need different names? I think it's a little unnatural to differ these things, extensions have so much and more functionality, what they lack for comparing to plugins?

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

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

发布评论

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

评论(3

贩梦商人 2024-10-08 05:37:20

区别既有历史的,也有现实的:

  • 插件是编译的、可加载的模块,最初源自 NPAPI;它们可以存在于浏览器的进程空间之外(这会导致各种有趣的互操作性问题和漏洞)。其中最常见的示例是 Flash 和 Java - 两者都请求子窗口(“视口”或“画布”(不是 HTML5 的 canvas - 这完全是另一回事:网页的本机部分))在网页内部并自行处理,其方式很大程度上独立于浏览器。
  • 扩展主要是用 JavaScript 和 XUL 编写的。由于扩展作为浏览器的一部分,因此它们比 JS-in-a-webpage 具有更广泛的访问权限,但它们仍然受到一些限制。最常见的集成方式是挂钩 FF 的某些功能并对其进行扩展。

因此,尽管插件和扩展可能看起来相关,但它们背后的技术却截然不同。

The difference is both historical and real:

  • plugins are compiled, loadable modules, originally descended from NPAPI; they can live outside of the browser's process space (which leads to all kinds of fun interoperability issues and vulerabilities). The most common examples of these are Flash and Java - both request a sub-window ("viewport" or "canvas" (not HTML5's canvas - that's something else altogether: a native part of the webpage)) inside the webpage and handle it themselves, in a way that's largely independent of the browser.
  • extensions are written mostly in JavaScript and XUL. Since the extensions act as part of the browser, they have wider access privileges than JS-in-a-webpage, but they are still subject to some limitations. The most common way of integration is to hook into some part of FF's functionality and extend it.

So, although the plugins and extensions might appear to be related, they're very different technologies behind the scenes.

淡淡離愁欲言轉身 2024-10-08 05:37:20

根据 Mozilla 的说法,插件可以帮助浏览器显示内容,例如播放媒体。扩展实际上为浏览器添加了新功能。

请参阅此处的前几段:
https://developer.mozilla.org/en/extensions

According to Mozilla, plugins help the browser display content, such as playing media. Extensions actually add new functionality to the browser.

See the first couple paragraphs here:
https://developer.mozilla.org/en/extensions

美羊羊 2024-10-08 05:37:20

一种是与 Firefox 并行运行的程序。他们得到一个画布,当他们在画布上绘画时,Firefox 会渲染它。著名的例子:Flash、Java、QuakeLive。

另一种是在 firefox 的 javascript 解释器/编译器中运行的程序。它们更直接地扩展了 Firefox 的功能,因为它们可以访问 Firefox 的内部结构,而不仅仅是一个画布。此外,它们更加可移植,因为它们不需要操作系统的底层支持。

两种方法都有优点和缺点,并且它们解决不同的任务。

One are programs which runs side-by-side of firefox. They get a canvas and when they paint on the canvas, firefox renders it. Notable examples: Flash, Java, QuakeLive.

The other are programs which run in the javascript interpreter/compiler of firefox. They extend firefox functionality more directly, since they have access to the firefox internals and are not merely a canvas. Also, they are much more portable since they do not require underlying support of the operating system as much.

There are advantages and disadvantages to both approaches, and they solve different tasks.

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