Tuesday, 9 March 2010

Mozilla previews new feature to guard against Flash crashes

Adobe CTO Kevin Lynch claims that the company's ubiquitous Flash plug-in doesn't ship with any known crash bugs. One can only assume that he has never used the software. As Adobe representatives exhibit an increasingly dismissive attitude about Flash's technical deficiencies, the browser vendors have stepped up to address the problems and are finding ways to insulate their users from Flash's poor security and lack of stability.

Several mainstream browsers isolate Flash and other plug-ins in separate processes in order to prevent an unstable plug-in from crashing the entire browser. Mozilla is preparing to introduce a similar feature in the next version of Firefox. A developer preview that was recently made available to users offers an early look at the new plugin crash protection.

Its part of a broader Mozilla project called Electrolysis that seeks to eventually bring full support for multiprocess browsing to Firefox. Electrolysis will make it possible for a browser crash to be isolated to a tab or group of tabs rather than affecting the entire browser. Similar functionality is already available in Internet Explorer and Chrome. Although Mozilla has already taken major steps towards implementing holistic multiprocess browsing, the plugin isolation is the only part that will land in the next release.

As we explained last year when we first covered Electrolysis, Mozilla has adopted parts of Chrome's interprocess-communication (IPC) implementation. In the latest developer preview build, it is used to facilitate interaction between the isolated plugins and the rest of the browser. Mozilla created its own protocol, called IPDL, that is used to define the messages that are passed between the processes through the IPC layer. For more details about IPDL, you can refer to the introductory tutorial that has been published at the Mozilla developer Web site.

In the developer preview, a plug-in that crashes will be replaced with a warning message. It will automatically transmit a crash report to Mozilla. You can resurrect the crashed plug-in by reloading the page. In the current implementation, each plug-in operates in its own process that runs separately from the rest of the browser. For example, when you load up pages that have Flash and Silverlight content, Flash and Silverlight will each have their own process. Individual plug-in instances are not isolated from each other.



As a result of this design, a single crashed plug-in instance will cause all other instances of the same plug-in to terminate, but will not affect content that is rendered by other plug-ins. A Flash crash will not affect running Silverlight content, and vice versa. For example, if I have a Silverlight demo in my first tab, a Flash video of the Internet's latest fad in my second tab, and I load Matthew Dempsky's Flash Crash demo in a third tab, both instances of the Flash plug-in will terminate but the Silverlight demo will continue running. The trololo man's magnificent song of ineffable wordless joy will be brutally silenced by Flash's ignominious inadequacy. Oh the humanity!



Mozilla is looking for users to help test the new feature and make sure that it works reliably. You can download builds of the developer preview from Mozilla's Web site.