Changes

Jump to: navigation, search

WebAPI/WebActivities/LessonsLearned

1,698 bytes added, 22:00, 16 May 2014
Differences between "data sources" and activities/intents
Similarly, the UI that comes up when an application tries to access "contacts" data sources, the user needs to be able to choose multiple applications that can provide that type of data. Normally for a WebActivity the user just picks a single application to handle the activity.
 
'''Recommended solutions'''
 
In FirefoxOS we have implemented a "shared indexeddb-like database" API which allows one application to write a database to disk which another application can then read without the need of starting the application that owns the data source.
 
This enabled us to allow reading "contacts" databases from multiple apps without worrying about launching multiple processes. When access to "contacts" is requested, we plan to render a "data source" specific UI which enables the user to pick multiple applications as well as choose if read vs. readwrite access is granted.
 
It also enables knowing when the data in a data source changes, and what changes were made. This way we can wake up applications that want to precompute thumbnails or do other heavy data operations. We can also enable the UA to provide applications with the list of changes that were made since last time they updated, without requiring that each data source needs to implement this algorithm.
 
This solution is still very experimental, and we still haven't figured out all the aspects of this.
 
We haven't figured out the security aspects of exposing write access to the "contacts" data sources, without worrying that a rouge app could simply delete or corrupt all the user's contacts. A simple yes/no security dialog doesn't feel like enough to protect the user. So for now we are sadly relying on similar mechanisms that we use to protect TCPSocket and SD-card access, i.e. signatures from a trusted party.
 
We also haven't figured out to to ensure that an app that has write access to contacts follows whatever format a contact should have.
 
So for v1 I would recommend to punt on "data sources".
Confirm
716
edits

Navigation menu