Electrolysis: Multiprocess Desktop Firefox

Multiprocess Desktop Firefox

Overview

Motiviation

Responsiveness

Image by Juan_Alvaro

Security

Image by Christopher Woo

History

  • September 2009: First Electrolysis Bug
  • March 2011: Out of Process Tabs for Firefox Mobile 4.0 Beta
  • June 2011: Out of Process Plugin Sandboxing
  • November 2011: Electrolysis project put on hold
  • February 2012: Firefox OS Demo (Process per App)
  • 2013: Reboot

Why try again?

Foundation

Image by Armcon Precast

Add-ons

Image by Paul Wilkinson

Demo

Common Pitfalls

Synchronous APIs

Before

        let result = finder.findAgain("test")
        showResult(result);
        

After

        finder.onresult = (result) => showResult(result)
        finder.findAgain("test")
        

Using child objects Ⅰ

Bad

        content.location.href = "next_test.html"
        

Great

        browser.loadURI("next_test.html")
        

Using child objects ⅠⅠ

Bad

        openDialog(browser.contentWindow)
        

Works

        openDialog(browser.ownerDocument.defaultView)
        

Using child objects ⅠⅠⅠ

Bad

        gBrowser.getBrowserForDocument(browser.contentDocument)
        

Great

        browser
        

Shim It!

Example

WebNavigation Shim

        function loadURI(uri) {
         sendAsyncMesssage("LoadURI", { uri: uri });
        }
        

Content-Script

        function recieveMessage(msg) {
         docShell.loadURI(msg.data.uri);
        }
        

Now in Nightly

Set browser.tabs.remote to true

Thanks

Red panda (Firefox) Project Page wiki.mozilla.org/Electrolysis Photo by by V31S70