Skip to content

Web API Extension Comparison

zliang7 edited this page Apr 23, 2013 · 5 revisions

Web API Extension Mechanisms:

NPAPI

NPAPI plugin is out of process, plugin process can do anything that developer want, renderer is still protected by sandbox. And the most important, it just works! We invented, designed, implemented and stabilized this idea several months ago. The only thing we need to do is enabling NPAPI plugin support in cameo.

Chrome Extension API

Looks like a good framework to extend WebAPI. But potentially it has severe issues to be a pluggable framework.

  • Chrome.* API is in higher layer than content API. I heard that we are trying to bring it down. This effort will break the original layered design of chromium which Google is doing recently. It will be great if we can finish this within reasonable effort. But I worry the change may getting huge.
  • There are still a lot of works need to do to make it pluggable.
    • Life-cycle management. Fortunately, we have experience about this since we have done the same work in NPAPI based approach. But it still needs some effort to implement this.
    • A plugin module should not have static dependencies on the host application. This means the plugin .so/.dll should not have symbol reference to the application binary. NPAPI host passes a function table to plugin while initializing. PPAPI does this better, browser provides many queryable PPB_* interfaces for plugin. To make chrome.* API pluggable, we need to do similar things: abstract and adapt host functionality as interfaces and pass the interface pointers to plugin at runtime.
    • SDK support We need to deliver a SDK package to developers, includes examples and documentation. We had done the same work when we engaged NAPAI based approach.

PPAPI

Limitations:

  • PPAPI is mostly used to serve for NaCl, not JavaScript. A PPAPI plugin can only communicated with JavaScript code through the PostMessage interface. This is awkward for Web developers and lacks synchronize support.
  • PPAPI is running inside sandbox. Privileged operations have to be delegated by UI process. Currently there is no plugin framework for the delegates.
  • PPAPI interface is not stable, Google may change it in the future since it is the only user currently.

NaCl

This approach has all limitations of PPAPI plugin based, and plus extreme complexity.

Introduction

Clone this wiki locally