|
|
| (2 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| == 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 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 [https://www.olivieryiptong.com/blog/a-case-for-remote-firefox-ui/ 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 [https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API 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.
| |