NPAPI

Last updated

Netscape Plugin Application Programming Interface (NPAPI) is a deprecated application programming interface (API) for web browser plugins, initially developed for Netscape Navigator 2.0 in 1995 and subsequently adopted by other browsers.

Contents

In the NPAPI architecture, a plugin declares content types (e.g. "audio/mp3") that it can handle. When the browser encounters a content type it cannot handle natively, it loads the appropriate plugin, sets aside space within the browser context for the plugin to render and then streams data to it. The plugin is responsible for rendering the data. The plugin runs in-place within the page, as opposed to older browsers that had to launch an external application to handle unknown content types. NPAPI requires each plugin to implement and expose approximately 15 functions for initializing, creating, deleting and positioning plugin content. NPAPI also supports scripting, printing, full-screen plugins, windowless plugins and content streaming.

NPAPI was frequently used for plugins which required intensive, low-level performance such as video players, including Adobe Flash Player and Microsoft Silverlight, as well as platforms for web applications such as the Java Runtime Environment.

NPAPI support among major browsers started to wane since 2015 and it was gradually deprecated over the following 7 years. All major web browsers have removed support for 3rd party NPAPI plugins for security and maintenance reasons while superior technology exists. [1]

Scripting support

Scripting is a feature allowing JavaScript code in a web page to interact with the plugin. Various versions of Netscape and then Mozilla supported this feature using different technologies, including LiveConnect, XPConnect, and NPRuntime.

LiveConnect

LiveConnect is a feature of Web browsers that allows Java and JavaScript software to intercommunicate within a Web page. From the Java side it allows an applet to invoke the embedded scripts of a page, or to access the built-in JavaScript environment, much as scripts can. Conversely, from the JavaScript side, it allows a script to invoke applet methods, or to access Java runtime libraries, much as applets can. [2] [3]

LiveConnect was used in Netscape 4 to implement scriptability of NPAPI plugins.

The Open Java Interface-dependent implementation of LiveConnect was removed from the Mozilla source code tree in late June 2009 as part of the Mozilla 2 cleanup effort. [4] It is no longer needed with the release of a redesigned Java Runtime Environment from Sun Microsystems. However the old implementation was restored for Gecko 1.9.2, as Apple had yet to port the newer JRE over to Mac OS X. [5]

The Java–JavaScript functionality supported by the redesigned Java Runtime Environment is still called "LiveConnect", despite the Open Java Interface-specific approach having been abandoned. [6] With Netscape 4, NPAPI was extended to allow plugins to be scripted. This extension is called LiveConnect. A plugin could implement a Java class and expose an instance of it. The class could be called from JavaScript and from Java applets running within the page.

The disadvantage of LiveConnect is, that it is heavily tied to the version of Java embedded within the Netscape browser. This prevented the browser from using other Java runtimes, and added bloat to the browser download size, since it required Java to script plugins. Additionally, LiveConnect is tricky to program: The developer has to define a Java class for the plugin, run it through a specialized Java header compiler, and implement native methods. Handling strings, exceptions, and other Java objects from C++ is non-obvious. In addition, LiveConnect uses an earlier and now obsolete application programming interface (API) for invoking native C++ calls from Java, called JRI. The JRI technology has long since been supplanted by JNI.

XPConnect

XPConnect (Cross Platform Connect) is a technology which enables simple interoperation between XPCOM and JavaScript.

Object connection

XPConnect allows JavaScript objects to transparently access and manipulate XPCOM objects. It also enables JavaScript objects to present XPCOM compliant interfaces to be called by XPCOM objects. A main goal is that objects communicating from either side of an XPCOM style interface should not generally need to know or care about the implementation language of the object on the other side of the interface.

XPConnect's primary reason for existence is to replace handwritten code used in places where native code needs to interact with JavaScript code. An example is the DOM module.

Security

Full privileges are only granted by default to chrome scripts, i.e. scripts that are part of the application or of an extension. For remote HTML/XHTML/XUL documents, most XPCOM objects are not accessible by the scripts as they have limited privileges due to security reasons. Even if they are accessible (e.g. the XMLHttpRequest object), the usual security restrictions can also be found (e.g. cannot open URLs of other domains).

Mozilla was already using XPCOM to define the interfaces to many objects implemented in C++. Each interface was defined by an IDL file, and run through an IDL compiler that produced header files and a language-neutral type library that was a binary representation of the interface. This binary described the interface, the methods, the parameters, the data structures and enumerations.

XPConnect uses the type library information to marshal calls between different thread contexts and between JavaScript and natively compiled C++. XPConnect is used extensively throughout Mozilla. Starting with Netscape 6.1 and Mozilla 0.9.2, NPAPI was extended, so that a plugin could return a scriptable interface to itself and XPConnect would marshal calls to it from JavaScript and the C++ implementation.

XPConnect has no Java dependency. However, the technology is based on XPCOM. Thus the plugin developer must be familiar with reference counting, interfaces and IDL to implement scripting. The dependency on XPCOM led to certain dynamic linking issues (e.g. the fragile base class problem) which had to be solved before the plugin would work correctly with different browsers. XPCOM has since been changed to supply a statically linked version to address such issues. This approach also requires an .xpt file to be installed next to the dynamic-link library (DLL); otherwise the plugin appears to work, but the scripting does not, causing confusion.

NPRuntime

At the end of 2004, all major browser companies using NPAPI agreed on NPRuntime [7] as an extension to the original NPAPI to supply scripting, via an API that is similar in style to the old C-style NPAPI and is independent of other browser technologies like Java or XPCOM. It is only supported by Firefox ESR (Extended Support Release) and Safari.

Support

Because of the age of the API, security issues, and adoption of alternative technologies such as HTML5, many software vendors began to phase out NPAPI support in 2013. [8] [9]

Internet Explorer

Internet Explorer versions 3 through 5.5 SP2 supported NPAPI, allowing plugins that functioned in Netscape Navigator to function in Internet Explorer. Support came via a small ActiveX control (named "plugin.ocx") that acted as a shim between ActiveX and the NPAPI plugin. Microsoft dropped support in version 5.5 SP2 onwards for security reasons. [10] [11] [12] [13]

Google Chrome

Google Chrome permanently dropped all NPAPI support from all platforms in September 2015. [14] In September 2013, Google announced that it would phase out NPAPI support in its Google Chrome browser during 2014, stating that "[its] 90s-era architecture has become a leading cause of hangs, crashes, security incidents, and code complexity". [15] [16] In May 2014, NPAPI support was removed from the Linux version of Chrome 35 and later. [17] In April 2015, Chrome for Windows and OS X (versions 42 and later) disabled NPAPI support by default. However, until September 2015 (version 45), users could re-enable NPAPI.[ citation needed ]

Opera

Opera dropped support with version 37 in May 2016.[ citation needed ]

Firefox

Mozilla Firefox release 52.0 in March 2017 removed all support for NPAPI except for Flash. [18] [19] [20] Meanwhile, the ESR channel retained general support for this feature with version 52 ESR being the last NPAPI resort. Firefox 69.0 disabled the Flash NPAPI by default. [21] [22] In Firefox 85.0, released in January 2021, NPAPI support was completely removed. [23] [24] In the ESR channel, support for Flash NPAPI ended with version 78.15.0, released in October 2021. [25] [26]

Safari

Safari has dropped support for all NPAPI plugins except for Flash with version 12 released in September 2018. [27] Flash support has been removed from Safari 14, released in September 2020. [28]

SeaMonkey

SeaMonkey [29] stopped supporting NPAPI plugins from version 2.53.1, with the exception of Flash. NPAPI support was completely removed in SeaMonkey 2.53.7, released in March 2021. [30]

Support

The following list of web browsers support all NPAPI plugins:

Similar technologies

ActiveX

Internet Explorer and browsers based on Internet Explorer use ActiveX controls, ActiveX documents and ActiveX scripting to offer in-page extensibility on par with NPAPI. Although commonly associated with Internet Explorer, ActiveX is integration technology that allows any computer program to integrate parts of other computer programs that support such integration. [38] Internet Explorer, however, is discontinued and its replacement, Microsoft Edge, does not support ActiveX.

PPAPI

On 12 August 2009 a page on Google Code [39] introduced a new project called Pepper, with the associated Pepper Plugin API (PPAPI); [40] PPAPI is a derivative of NPAPI aimed to make plugins more portable and more secure. [41] This extension is designed specifically to ease the implementation of out-of-process plugin execution.

PPAPI was initially only supported by Google Chrome and Chromium. Later, other Chromium-based browsers such as Opera and Vivaldi added PPAPI plugin support.

In February 2012 Adobe Systems announced that future Linux versions of Adobe Flash Player would be provided only via PPAPI. The previous release, Flash Player 11.2, with NPAPI support, would receive security updates for five years. [42] In August 2016 Adobe announced that, contrary to their previous statement, it would again support the NPAPI Flash Player on Linux and keep releasing new versions of it. [43]

In August 2020, Google announced that support for PPAPI would be removed from Google Chrome and Chromium in June 2022. [44]

See also

Related Research Articles

<span class="mw-page-title-main">Java applet</span> Small application written in Java

Java applets are small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode, applets were deprecated by Java 9 in 2017.

<span class="mw-page-title-main">Plug-in (computing)</span> Software component that adds a specific feature to an existing software application

In computing, a plug-in is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization.

Cross Platform Component Object Model (XPCOM) is a cross-platform component model from Mozilla. It is similar to Component Object Model (COM),Common Object Request Broker Architecture (CORBA) and system object model (SOM). It features multiple language bindings and interface description language (IDL) descriptions; thus programmers can plug their custom functions into the framework and connect it with other components.

<span class="mw-page-title-main">ActiveX</span> Software framework by Microsoft introduced in 1996

ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide Web. Microsoft introduced ActiveX in 1996. In principle, ActiveX is not dependent on Microsoft Windows operating systems, but in practice, most ActiveX controls only run on Windows. Most also require the client to be running on an x86-based computer because ActiveX controls contain compiled code.

XUL, which stands for XML User Interface Language, is a user interface markup language developed by Mozilla. XUL is an XML dialect for writing graphical user interfaces, enabling developers to write user interface elements in a manner similar to web pages.

<span class="mw-page-title-main">Firefox</span> Free and open-source web browser by Mozilla

Mozilla Firefox, or simply Firefox, is a free and open source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current and anticipated web standards. Firefox is available for Windows 10 and later versions of Windows, macOS, and Linux. Its unofficial ports are available for various Unix and Unix-like operating systems, including FreeBSD, OpenBSD, NetBSD, and other platforms. It is also available for Android and iOS. However, as with all other iOS web browsers, the iOS version uses the WebKit layout engine instead of Gecko due to platform requirements. An optimized version is also available on the Amazon Fire TV as one of the two main browsers available with Amazon's Silk Browser.

This is a comparison of both historical and current web browsers based on developer, engine, platform(s), releases, license, and cost.

A Rich Internet Application is a web application that has many of the characteristics of desktop application software. The concept is closely related to a single-page application, and may allow the user interactive features such as drag and drop, background menu, WYSIWYG editing, etc. The concept was first introduced in 2002 by Macromedia to describe Macromedia Flash MX product. Throughout the 2000s, the term was generalized to describe browser-based applications developed with other competing browser plugin technologies including Java applets, Microsoft Silverlight.

Add-on is the Mozilla term for software modules that can be added to the Firefox web browser and related applications. Mozilla hosts them on its official add-on website.

The Mozilla application framework is a collection of cross-platform software components that make up the Mozilla applications. It was originally known as XPFE, an abbreviation of cross-platform front end. It was also known as XPToolkit. To avoid confusion, it is now referred to as the Mozilla application framework.

A browser extension is a software module for customizing a web browser. Browsers typically allow users to install a variety of extensions, including user interface modifications, cookie management, ad blocking, and the custom scripting and styling of web pages.

A local shared object (LSO), commonly called a Flash cookie, is a piece of data that websites that use Adobe Flash may store on a user's computer. Local shared objects have been used by all versions of Flash Player since version 6.

<span class="mw-page-title-main">Microsoft Silverlight</span> Application framework for writing and running rich Internet applications

Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. While early versions of Silverlight focused on streaming media, later versions supported multimedia, graphics, and animation, and gave support to developers for CLI languages and development tools. Silverlight was one of the two application development platforms for Windows Phone, but web pages using Silverlight did not run on the Windows Phone or Windows Mobile versions of Internet Explorer, as there was no Silverlight plugin for Internet Explorer on those platforms.

<span class="mw-page-title-main">Google Chrome</span> Web browser developed by Google

Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, and also for Android, where it is the default browser. The browser is also the main component of ChromeOS, where it serves as the platform for web applications.

Google Native Client (NaCl) is a discontinued sandboxing technology for running either a subset of Intel x86, ARM, or MIPS native code, or a portable executable, in a sandbox. It allows safely running native code from a web browser, independent of the user operating system, allowing web apps to run at near-native speeds, which aligns with Google's plans for ChromeOS. It may also be used for securing browser plugins, and parts of other applications or full applications such as ZeroVM.

<span class="mw-page-title-main">WebGL</span> JavaScript bindings for OpenGL in web browsers

WebGL is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics, image processing, and effects in the HTML canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.

HTML video is a subject of the HTML specification as the standard way of playing video via the web. Introduced in HTML5, it is designed to partially replace the object element and the previous de facto standard of using the proprietary Adobe Flash plugin, though early adoption was hampered by lack of agreement as to which video coding formats and audio coding formats should be supported in web browsers. As of 2020, HTML video is the only widely supported video playback technology in modern browsers, with the Flash plugin being phased out.

Browser security is the application of Internet security to web browsers in order to protect networked data and computer systems from breaches of privacy or malware. Security exploits of browsers often use JavaScript, sometimes with cross-site scripting (XSS) with a secondary payload using Adobe Flash. Security exploits can also take advantage of vulnerabilities that are commonly exploited in all browsers.

References

  1. "The End of Applets". InfoQ. Retrieved 2021-10-02.
  2. Flanagan, David. (2006). JavaScript: the Definitive Guide. O'Reilly, Sebastopol, California.
  3. For technical details, see the Mozilla Developer Documentation on LiveConnect Archived 2008-05-14 at the Wayback Machine .
  4. "442399 – remove LiveConnect from the tree". mozilla.org.
  5. "517355 – Restore OJI, Liveconnect and the JEP on the 1.9.2 branch on OS X". mozilla.org.
  6. "Release Notes for the Next-Generation Java™ Plug-In Technology (introduced in Java SE 6 update 10)". sun.com.
  7. "Scripting plugins". Mozilla Developer Network. Archived from the original on 2008-11-18. Retrieved 2009-08-29.
  8. "Change in support for Acrobat and Reader plug-ins in modern web browsers". Adobe. 8 February 2016.
  9. "Oracle deprecates the Java browser plugin, prepares for its demise". Ars Technica. 28 January 2016. Retrieved 15 April 2016.
  10. "Netscape-Style Plug-ins Do Not Work After Upgrading Internet Explorer". Support (3.3 ed.). Microsoft. 27 July 2007.
  11. Giannandrea, J. (4 September 2001). "Microsoft breaks Web Plugins in Windows XP". meer.net. Archived from the original on 16 October 2007.
  12. "Description of Internet Explorer Support for Netscape-Style Plug-ins". Support (3.4 ed.). Microsoft. 31 January 2007.
  13. "Microsoft Security Bulletin MS03-015 – Critical". Security TechCenter. Microsoft. 23 April 2003.
  14. "The final countdown for NPAPI". Chromium Blog.
  15. Google will start blocking most Netscape Plug-In API plug-ins in January 2014, will whitelist Silverlight, Unity & others". TechCrunch. 23 September 2013.
  16. "Google looks to drop Netscape Plugin API support in Chrome, starting with blocking most plugins in January 2014". The Next Web. 23 September 2013.
  17. "Update on NPAPI deprecation". Chromium Blog. 27 May 2014.
  18. "Firefox 52.0, See All New Features, Updates and Fixes". Mozilla.
  19. "Firefox dropping NPAPI plugins by the end of 2016—except for Flash". Firefox Site Compatibility. 4 October 2016. Archived from the original on 15 March 2017. Retrieved 25 January 2017.
  20. "Why do Java, Silverlight, Adobe Acrobat and other plugins no longer work?". Mozilla support. Archived from the original on 2017-03-07. Retrieved 2017-03-06.
  21. "1519434 - Disable Flash support by default in Firefox 69". bugzilla.mozilla.org. Retrieved 2019-01-14.
  22. "Plugin Roadmap for Firefox - Plugins". MDN Web Docs . Retrieved 2021-07-12.
  23. Jim Mathies (13 November 2020). "Removal of NPAPI plugin support in Firefox 85". mozilla.dev.platform (via Google Groups). Retrieved 10 February 2021.
  24. "Plugin Roadmap for Firefox". MDN. 19 January 2021. Archived from the original on 21 January 2021. Retrieved 10 February 2021.
  25. "Firefox for Enterprise 91 - Release notes | Firefox for Enterprise Help". support.mozilla.org. Retrieved 2022-02-13.
  26. "Firefox ESR 78.15.0, See All New Features, Updates and Fixes". Mozilla. Retrieved 2022-01-03.
  27. Clover, Juli (September 17, 2018). "Apple Releases Safari 12 for macOS Sierra and macOS High Sierra". MacRumors.
  28. "Safari 14 Release Notes". Apple Developer Documentation.
  29. "Why do Oracle Java, Microsoft Silverlight, Adobe Acrobat Reader and other plugins no longer work?" NPAPI plugins
  30. "SeaMonkey 2.53.7 Release Notes" . Retrieved 14 March 2021.
  31. "NPAPI 是重型武器,当别的方法无法到达你的目的时,才建议使用。". NPAPI 插件.
  32. "Support for all NPAPI plugins (Unity, Silverlight, Flash, Java, authentication plugins, etc.)". Basilisk features.
  33. "Most third-party plug-ins designed for Mozilla/Netscape will also work with K-Meleon".Third party plugins.
  34. "Load all NPAPI-Plugins, Java, Silverlight, etc." K-Meleon Hybrid (Goanna over Pro).
  35. "Full and ongoing support for NPAPI plugins (Java, Silverlight, etc.)". Pale Moon: Technical Details
  36. "Pale Moon supports NPAPI plug-ins. Unlike Firefox, we will not be deprecating or removing support for these kinds of plug-ins". Pale Moon future roadmap.
  37. "We use the NPAPI plugin architecture (just like Mozilla) so just install the plugins normally, and things should work". Uzbl FAQ.
  38. "Description of ActiveX Technologies". Support. Microsoft. 19 January 2007.
  39. "ppapi". Google Code . Archived from the original on 2010-07-02.
  40. "Getting Started: Background and Basics – The Chromium Projects". chromium.org.
  41. "Concepts - ppapi - Important concepts for working with PPAPI. - Pepper Plugin API – Google Project Hosting". google.com.
  42. "Adobe and Google Partnering for Flash Player on Linux". adobe.com. Archived from the original on 2012-02-23. Retrieved 2012-03-07.
  43. Campbell, Chris (31 August 2016). "Beta News – Flash Player NPAPI for Linux". Adobe AIR and Adobe Flash Player Team Blog. Adobe Systems. Retrieved 8 September 2016.
  44. Anthony Laforge (August 10, 2020). "Changes to the Chrome App Support Timeline". Chromium Blog.