MozillaZine

Plugin-container and out-of-process plugins

From MozillaZine Knowledge Base

This article describes a crash protection feature in current Mozilla browsers, in which plugins are run in a separate process. It was written for Firefox but also applies to SeaMonkey 2.1 and above.

Contents

Crash protection

Starting in Firefox 3.6.4 on Windows and Linux, a new crash protection feature isolates certain plugins from the browser process and sets those plugins to each run in a separate plugin-container process. Before this new "out-of-process plugins" ("OOPP") crash protection feature, a problem with a plugin (e.g, Adobe Flash) would often cause the entire Firefox browser to crash. When an "out-of-process plugin" stops working, Firefox can remain running and just the portions of a webpage that need the plugin will be disabled (i.e., missing the plugin content).

In Firefox 3.6 releases since Firefox 3.6.4, the crash protection feature that sets plugins to run in a separate process is enabled for specified plugins only. By default, the plugins enabled to run "out-of-process" are the NPAPI test plugin, Adobe Flash, Apple QuickTime (Windows) and Microsoft Silverlight (Windows). [1]

These "whitelisted" plugins in Firefox 3.6 releases (Firefox 3.6.4 and above) are each specified in a separate dom.ipc.plugins.enabled.<filename> preference that is set to true for each OOPP-enabled plugin. (Crash protection is disabled by default for all other plugins so, by default, the dom.ipc.plugins.enabled preference that permits all plugins to run "out-of process" is set to false.)

Note: This new crash protection feature is available for Mac OS (10.6 or higher) in Firefox 4 and above. [2] [3]

Plugin-container

For each plugin for which the "OOPP" crash protection feature is enabled, a separate plugin process will be started when you first visit a webpage that evokes that plugin. When you exit Firefox, those plugin-container processes will terminate. This plugin process is named "plugin-container" on Linux, "plugin-container.exe" on Windows, and "Firefox Plugin Process (<plugin-name>)" on Mac OS.

Important: Your firewall or other security software may block the plugin-container process and prevent a plugin from working. If you are asked for permission to allow the plugin-container process to access the Internet, you should allow it. If you previously denied access, you should change your security software program settings to allow plugin-container. [4] [5] [6]

Plugin error dialog

Firefox will automatically use an installed and enabled plugin for embedded webpage content, such as Flash videos on YouTube. If the plugin crashes or if Firefox detects that the plugin has stopped responding, the plugin will terminate and you will see an error dialog on the webpage, instead of the content that uses the plugin. To send a crash report to Mozilla, click the Send crash report link in the error dialog.

Disabling crash protection

In some cases you may want to disable the "out-of-process plugins" (OOPP) crash protection feature; e.g., to troubleshoot problems that first appeared in Firefox 3.6.4 or above. To disable crash protection, go to about:config and set to false all preferences starting with dom.ipc.plugins.enabled. (It is possible that your browser has only that preference entry without any addition.) This will prevent the "plugin-container" process from running and all plugins will run within the Firefox browser process.

Firefox 3.6.x

To disable crash protection in Firefox 3.6 releases (3.6.4 and above) type about:config in the Location Bar (address bar) and press the Enter key. When the list of preferences appears, type dom.ipc.plugins.enabled to find the following preferences. (Each preference specifies an "out-of-process" plugin by its filename; the name shown in parentheses is for informational purposes only):

On Linux:

  • dom.ipc.plugins.enabled.libflashplayer.so (Adobe Flash)
  • dom.ipc.plugins.enabled.libnptest.so (NPAPI test plugin)

On Windows:

  • dom.ipc.plugins.enabled.npctrl.dll (Microsoft Silverlight)
  • dom.ipc.plugins.enabled.npqtplugin.dll (Apple QuickTime)
  • dom.ipc.plugins.enabled.npswf32.dll (Adobe Flash)
  • dom.ipc.plugins.enabled.nptest.dll (NPAPI test plugin)

Toggle (double-click) each preference to change the value from "true" to false, as shown below on Windows.

Image:Fx366-OOPP.PNG

Note: In Firefox 3.6 releases (3.6.4 and above) the preference dom.ipc.plugins.enabled is already set to "false", by default.

Firefox 4 and above

This applies to Firefox pre-release builds (3.7a1pre and above) and Firefox 4 Beta as well as Firefox 4.0 and later releases. For more information about Firefox test builds, see Testing pre-release versions.

Mac OS

On Mac OS (10.6 or above), in Firefox 4 Beta releases previous to Beta 7, only certain plugins (Flash Player and Java) were "whitelisted" to run out-of-process by default. These plugins were set to "true" in the preference dom.ipc.plugins.enabled.<filename>.

Starting in Firefox 4 Beta 7, the following preferences are set to "true" , by default:

  • dom.ipc.plugins.enabled.i386.flash player.plugin
  • dom.ipc.plugins.enabled.i386.javaplugin2_npapi.plugin
  • dom.ipc.plugins.enabled.x86_64

Important: Starting in Firefox 4 Beta 7, when Firefox is run in 64-bit mode (the default for 64-bit Mac OS 10.6) all plugins are set to run out-of-process via the dom.ipc.plugins.enabled.x86_64 preference, which is set to "true" by default. If you change this preference to "false" when running in 64-bit mode, some or all of your plugins will not work. Note that not all 32-bit plugins will run in 64-bit mode. Only plugins that use the Cocoa version of NPAPI will load; any i386 (32-bit) plugin still using Carbon NPAPI won’t load (e.g., Flash plugins previous to version 10.1 will not work when Firefox is run in 64-bit mode). [7] [8] To troubleshoot plugins in Firefox 4.0 Beta 7 and above, set Firefox to run in 32-bit mode (close Firefox, control-click the Firefox.app icon, select "Get Info", and then check the box, "Open in 32-bit mode") before disabling crash protection.

Windows and Linux

In Firefox 4 and above on Windows and Linux, the preference dom.ipc.plugins.enabled is set to true by default and the OOPP crash protection feature is enabled for all plugins, with the exception of Java on Windows ( see below). To disable crash protection, toggle this preference from "true" to false. If you only want to disable certain plugins from running "out-of-process", you can "blacklist" each plugin by creating a new boolean preference dom.ipc.plugins.enabled.<filename> and setting its value to false. Filenames of specific plugins can be found in about:plugins and should be entered in lower-case. [9]

Flash plugin on Windows Vista and above

Starting in Firefox 14, Flash is force-enabled to run out-of-process in a plugin-container process on Windows Vista and above, because of stability issues when OOPP is disabled (bug 769721). [10] [11]

Java plugin on Windows

On Windows, the preference dom.ipc.plugins.java.enabled was added (starting in trunk builds after 10-15-2010) and is set to false by default, to prevent Java from running inside a plugin-container process because of stability issues when OOPP for Java is enabled (bug 603417). [12]

Plugin hang detector

In Firefox 3.6.4 and above, a plugin hang detector determines when an out-of-process plugin or plugin script has stopped responding, so that Firefox can terminate the plugin. The time period that must pass before the plugin is assumed to be locked up is set in the preference dom.ipc.plugins.timeoutSecs (the default is 45 seconds in Firefox 3.6.6). [13] When Firefox terminates a plugin that is no longer responding, you will see the "plugin has crashed" error dialog shown above. To prevent Firefox from terminating plugins it considers non-responsive, set dom.ipc.plugins.timeoutSecs to -1 in about:config. This disables the plugin hang detector but does not disable OOPP or stop "plugin-container" from running; to do that, you must set the dom.ipc.plugins.enabled.* preferences to "false" (see above).

See also

External links

Related bug reports