Mobile/EmbeddingUseCases

From MozillaWiki
Jump to: navigation, search

Overview

This document is a work in progress which describes the use cases that should drive where we should invest to make our embedding story stronger for our users and partners. We believe that this strategy should include more than just C and C++ embedding APIs (although those are very important) but also allow people who want to use our engine to leverage the tools of the web in a full app context. Taking advantage of client side storage, XUL, html, the and the rich set of libraries available in the context of the web is also an important part of that story.

Create your own browser

This is the classic embedding use case, and is the one that we are most suited at the moment. This is what MicroB is on the Nokia N800/N810 and other Mozilla-based browsers.

Main Features

  • Includes most browser components and features such as
    • Cookie store
    • Disk cache
    • Preferences
    • etc
  • Focused on consuming content from the web
  • May or may not include extensions that are exposed to the web (mobile, platform features
  • Usually built to create a more integrated experience

Required APIs

  • Page loading
  • Page rendering
  • JS api additions to window objects
  • Full profile support

Create a Non-browser App

This use case is the classic XULRunner use case. In order to build a quick app using the technology and layout of the web, we should allow people to have installable XUL packages that let an app be exposed to the user. Also, it's very likely that in the mobile case that additional APIs will be included in the base XUL platform that expose platform capabilities that it's not appropriate to expose to the web and untrusted content.

Main Features

  • Includes the full XUL platform
  • Allows you to install bundles that show up as full apps as opposed to being surfaced in the browser
  • JS api additions to window + app objects
  • May or may not include full profile support

Required APIs

  • XUL (duh.)
  • JS api additions
  • "app" installation
  • Pick-your-profile

Embedding Gecko Into Another App

This is embedding our rendering into another app - likely something C or C++ based. Because of the possible wide use cases here we need a great deal of flexibility in terms of what apps might want to surface. Sometimes they will want to pull and query data from the web, sometimes they will want to render local content, sometimes they will want to pull data from the web and display it. Also, one of the most common use cases here is one in which no profile data is wanted at all. Much of our code currently assumes that we have a profile so we'll have to do some work to figure out how to drive those changes. Additionally this is one area where startup performance is important so we will have to look at ways to improve that as well.

Main Features

  • Fast startup
  • No-profile operation
  • Easy to use and well documented C/C++ API
  • Relatively stable interfaces
  • Non-window operation (i.e. get me this file at this url or pull this doc down, parse it and give me a DOM to work with.)
  • Possible to root new JS objects in the engine

Required APIs

  • Pick-your-profile size
  • Embedding APIs
  • Platform-specific APIs to expose capabilities that are easy to use
  • APIs that make it possible to bind other languages to the API

Embedded JavaScript

TODO