RemotelyHostedResources

From MozillaWiki
Revision as of 19:26, 7 January 2016 by Oyiptong (talk | contribs) (Created page with "== Remotely Hosted Resources == A remotely hosted resource is a way to write and ship code for Firefox that is: # implemented using regular HTML/CSS/JS # unprivileged # not...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Remotely Hosted Resources

A remotely hosted resource is a way to write and ship code for Firefox that is:

  1. implemented using regular HTML/CSS/JS
  2. unprivileged
  3. not necessarily checked-in to mozilla-central

The goals we're trying to achieve are to:

  • speed up development time
  • speed up deployment time
  • increase safety
  • increase security
  • increase product quality via quicker iteration enabled

Some of the motivation and benefits for remote pages are described further in a separate blog post.

This document is concerned about describing the techniques used to create remotely hosted UIs.

Core Architecture Overview

The pages are loaded from the network and are cached locally. Offline capability is implemented via Service Worker APIs. An additional layer of offline capability can be added by shipping a local copy of the resources within Firefox, and loading that in case the network is not available..

Another core piece of this architecture is about how to provide additional functionality to an otherwise unprivileged document. We do so by defining and implementing purpose-built Web APIs. We do so by creating new Web APIs made specially for the features desired. Those APIs are only enabled for the origin we choose and probably localhost for testing.

Updates

Updates to the pages are controlled via Cache-Control headers. I.e one can control how often Firefox will fetch new copies of the pages just by setting a header.

However, there will be two speeds for updates that are divided by the IDL boundary: IDL implementations and desktop-code and the remote resources which are consumers of the IDL.