What is The difference between Firefox extension and plugin?

19,981

Solution 1

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.

Solution 2

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

Solution 3

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.

Share:
19,981

Related videos on Youtube

Tom Smykowski
Author by

Tom Smykowski

Updated on November 16, 2020

Comments

  • Tom Smykowski
    Tom Smykowski over 3 years

    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?

  • Piskvor left the building
    Piskvor left the building over 13 years
    +1. Minor correction: a plugin's canvas is by default rendered directly by the plugin, bypassing the browser altogether (where e.g. Flash's wmode=transparent attribute is a bit of a workaround for this).
  • user2508301
    user2508301 over 13 years
    A much more precise answer than mine!
  • d512
    d512 almost 10 years
    imo, this answer is more valuable than the accepted one (which, while accurate, gets too down into implementation details and his hard to follow (in part because it contains nested parentheses)). This answer gives a high level overview that someone non experienced with these technologies can understand.
  • Piskvor left the building
    Piskvor left the building about 7 years
    And now there are XUL extensions and WebExtensions - the former are apparently deprecated, and the latter are anemic. Yay.