Browser extensions

from Wikipedia, the free encyclopedia

Browser Extensions ( English for browser extensions , also called WebExtensions ) is a standard for browser extensions that is implemented in most current web browsers . The format is based on the extensions for Google Chrome , but is now also supported by other browsers and jointly developed.

Surname

The standard uses the generic name Browser Extensions as a designation . Opera developers prefer Navigator Extensions , while Mozilla uses the term WebExtensions .

history

For a long time, every browser had its own format for extensions, only very closely related browsers used the same format. Google developed its own extension format for Chrome, which is based entirely on web technologies.

When Opera switched to the Blink rendering engine in 2013 with version 15 , support for Google's browser extensions with some Opera-specific additions was introduced, while Opera developers expressed the idea of ​​making the format a cross-browser standard.

Three years later, in May 2016, Opera, Microsoft and Mozilla formed the Extensions Community Group to specify the format.

Shortly afterwards Microsoft introduced the support with Edge 10, at the same time Mozilla's implementation with Firefox 48 reached a stable status.

Since the end of 2017, Firefox 57 WebExtensions are the only supported extension format in Firefox. This led to the development of WaterFox and CyberFox , Firefox 52 ESR-based alternatives, with the aim of maintaining backward compatibility with the old add-on format.

The aim of the standard is initially to specify a common format and the most important programming interfaces (APIs). This should make it possible to write browser extensions that either work directly in all browsers or at least can be created directly for all browsers from a common code base. In addition to the standard, browsers can implement their own APIs, which can then be used by extensions in this browser.

technology

Browser extensions consist of several files, which are usually combined in a ZIP container . The central file is manifest.jsona file in JSON format with important data about the extension. In addition to general metadata such as the name of the extension and details of the developer, this file also contains the permissions that are necessary for the extension and it specifies which code should be executed in which situation. For example, if a certain code is to be executed on all Wikipedia pages , it can be specified with the following entry in the manifest file:

"content_scripts": [{
	"matches": ["https://*.wikipedia.org/*"],
	"js": ["code.js"]
}]

The code itself is written in JavaScript ; HTML and CSS are also used, for example for configuration pages. In addition to the usual APIs that are available to all websites, the extension can browserinteract with the browser and the accessed page via the global object, depending on the permissions granted. An extension can create a bookmark with the following code , provided that it has the authorization to do so:

browser.bookmarks.create({
	title: 'Wikipedia',
	url: 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite'
});

Different browsers provide different APIs, on the one hand because some interfaces have yet to be implemented, and on the other hand because certain functions are fundamentally not provided in some browsers. So the API to implement a sidebar is only available in browsers that actually use sidebars and is absent in other browsers. As usual for websites, such differences between the browsers can be recognized and handled appropriately by the presence or absence of the corresponding methods. There are also polyfills that compensate for the differences between the browsers.

Strict CSP rules apply to extensions so that security gaps in browser extensions cannot easily be used to inject malicious code. However, these can also be relaxed if necessary. In addition, the usual same-origin policy applies , so an extension can only read its own data. This restriction can also be lifted or relaxed if necessary. In addition to the standard, browsers also usually require the extension to contain a digital signature .

compatibility

Google Chrome supports these browser extensions from version 4, but in the original version. In particular, the global object is not called browserbut chrome. The ZIP file has a special header and is used as a file extension crxfor Chrome Extension .

Opera supports the format from version 15 and uses chromethe global object oprfor its own APIs in addition to the -object . The file extension used by Opera nexfor Navigator Extension . The implementation is largely compatible with Google Chrome, with only a few missing APIs and a few additional features.

Firefox gradually introduced support from version 42 and expanded the scope continuously with the following versions. The APIs can be accessed via the global browserobject or via chrome. The majority of the existing Chrome extensions work in Firefox too. As for previous Firefox extensions, the file extension is still xpiused.

Microsoft Edge implements the standard from version 14 and offers an automatic conversion tool with which extensions written for Chrome can also be made usable for Edge.

Individual evidence

  1. Rich Tibbet: Introducing NEX - standards-Oriented browser add-ons. In: Dev.Opera. July 30, 2013, accessed June 29, 2017 .
  2. Shwetank Dixit: For a Better Extensions Ecosystem. In: Dev.Opera. May 3, 2016, accessed June 29, 2017 .
  3. Kyle Pflug: Introducing EdgeHTML 14 with the Windows 10 Anniversary Update. In: Microsoft Edge Dev Blog. August 4, 2016, accessed June 29, 2017 .
  4. Firefox - Notes (48.0). Retrieved June 29, 2017 .
  5. Kev Needham: Add-ons in 2017. In: Mozilla Add-ons Blog. November 23, 2016, accessed June 29, 2017 .
  6. CRX Package Format. Retrieved June 29, 2017 .
  7. Extension APIs Supported in Opera. In: Dev.Opera. Retrieved June 29, 2017 .
  8. Kev Needham: The Future of Developing Firefox Add-ons. In: Mozilla Add-ons Blog. August 21, 2015, accessed June 29, 2017 .
  9. ^ Andy McKay: WebExtensions and parity with Chrome. In: Mozilla Add-ons Blog. September 13, 2016, accessed June 29, 2017 .
  10. Andy McKay: How many Chrome Extensions run in Firefox? November 18, 2016, accessed June 29, 2017 .
  11. Porting an extension from Chrome to Microsoft Edge. In: Microsoft Edge documentation. Retrieved June 29, 2017 .

Web links