Confirmed users
169
edits
Mixedpuppy (talk | contribs) |
Mixedpuppy (talk | contribs) |
||
| Line 53: | Line 53: | ||
* NOTE: Initial release of Firefox Share Alpha (Q3 or early October) does not inject the navigator.* APIs into browser tab content. It is intended that we will re-enable that functionality in a near-future release. | * NOTE: Initial release of Firefox Share Alpha (Q3 or early October) does not inject the navigator.* APIs into browser tab content. It is intended that we will re-enable that functionality in a near-future release. | ||
The following illustrates how data flows through the system when talking about mediated web activities such as F1. | |||
[[File:MediatedActivities.png]] | |||
'''Other Resources''' | '''Other Resources''' | ||
| Line 74: | Line 78: | ||
** for has patch from [https://bugzilla.mozilla.org/show_bug.cgi?id=675812 bug 675812] which fixes panel style for osx | ** for has patch from [https://bugzilla.mozilla.org/show_bug.cgi?id=675812 bug 675812] which fixes panel style for osx | ||
=== | === Mediator content iframe === | ||
F1 is an implementation of a mediator for the share activity. The mediator content iframe is content | |||
loaded locally from the addon. APIs (navigator.mozApps.mediator.*) are injected by the mediator class. Communication between the content iframe and the mediator class are through sdk ports, passing JSON data. | |||
'''Stored Data:''' | '''Stored Data:''' | ||
The mediator stores no data. | |||
'''Communication with | '''Communication with service content iframes''' | ||
Communication with service iframes is tunneled through the mediator class. There is no direct conduit | |||
between the mediator content and the service content (even though the mediator content could directly access the service iframe). | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 109: | Line 101: | ||
| ''In:'' | | ''In:'' | ||
| getParameters | | getParameters | ||
| | | parameter information for ui configuration and oauth | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| getParameters | | getParameters | ||
| | | none | ||
| | | | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| getShareTypeRecipients | | getShareTypeRecipients | ||
| | | abbreviated contact data for autocompletion support | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| getShareTypeRecipients | | getShareTypeRecipients | ||
| | | type of share (e.g. direct, public, group name) | ||
| | | | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| resolveRecipients | | resolveRecipients | ||
| | | success/error of recipient validation | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| resolveRecipients | | resolveRecipients | ||
| | | list of recipients user has entered into TO field | ||
| | | | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| getLogin | | getLogin | ||
| | | user profile on success | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| getLogin/getCredentials | | getLogin/getCredentials | ||
| | | none | ||
| | | | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| setAuthorization (1) | | setAuthorization (1) | ||
| | | none | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| setAuthorization | | setAuthorization | ||
| | | oauth credentials | ||
| | | | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| confirm (2) | | confirm (2) | ||
| | | success/error of send | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| confirm | | confirm | ||
| | | page data(3) | ||
| | | called when the user clicks "send" | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| Line 185: | Line 177: | ||
3. page information such as URL, opengraph data, Title, select share image (currently the first one found), etc. | 3. page information such as URL, opengraph data, Title, select share image (currently the first one found), etc. | ||
'''Communication with mediator class''' | |||
{| class="wikitable" | |||
|- | |||
! Direction | |||
! Message | |||
! Data | |||
! Notes | |||
|- | |||
| ''In:'' | |||
| x | |||
| none | |||
| | |||
|- | |||
| ''Out:'' | |||
| x | |||
| | |||
| | |||
|} | |||
=== service content iframes === | |||
For each installed service that supports a given activity, the mediator content creates an iframe. The mediator class then injects APIs into the service iframe using the addon-sdk worker class. | |||
Currently, F1 does not allow installation of remote services. It installs three services that are contained in the addon, Twitter, Facebook and GMail. | |||
'''Stored Data:''' | '''Stored Data:''' | ||
While a service may store any data it wants in localStorage, these are the data that our implementations store. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 203: | Line 220: | ||
| localstorage | | localstorage | ||
|- | |- | ||
| users oauth credentials | | users oauth credentials, secrets, etc | ||
| localstorage (see oauthorizer component) | | localstorage (see oauthorizer component) | ||
|} | |} | ||
'''Communication with | '''Communication with mediator content iframe''' | ||
Communication with mediator content is tunneled through the mediator class. There is no direct conduit | |||
between the mediator content and the service content (even though the mediator content could directly access the service iframe). | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 220: | Line 237: | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| | | getParameters | ||
| | | none | ||
| | | | ||
|- | |||
| ''Out:'' | |||
| getParameters | |||
| parameter information for ui configuration and oauth | |||
| | |||
|- | |||
| ''In:'' | |||
| getShareTypeRecipients | |||
| type of share (e.g. direct, public, group name) | |||
| | |||
|- | |||
| ''Out:'' | |||
| getShareTypeRecipients | |||
| abbreviated contact data for autocompletion support | |||
| | |||
|- | |||
| ''In:'' | |||
| resolveRecipients | |||
| list of recipients user has entered into TO field | |||
| | |||
|- | |||
| ''Out:'' | |||
| resolveRecipients | |||
| success/error of recipient validation | |||
| | |||
|- | |||
| ''In:'' | |||
| getLogin | |||
| none | |||
| | |||
|- | |||
| ''Out:'' | |||
| getLogin/getCredentials | |||
| user profile on success | |||
| | |||
|- | |||
| ''In:'' | |||
| setAuthorization (1) | |||
| oauth credentials | |||
| | |||
|- | |||
| ''Out:'' | |||
| setAuthorization | |||
| none | |||
| | |||
|- | |||
| ''In:'' | |||
| confirm (2) | |||
| page data(3) | |||
| called when the user clicks "send" | |||
|- | |||
| ''Out:'' | |||
| confirm | |||
| success/error of send | |||
| | |||
|- | |||
| ''In:'' | |||
| logout/clearCredentials | |||
| none | |||
| | |||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| logout/clearCredentials | |||
| none | |||
| | |||
|} | |||
'''Communication with mediator class''' | |||
{| class="wikitable" | |||
|- | |||
! Direction | |||
! Message | |||
! Data | |||
! Notes | |||
|- | |||
| ''In:'' | |||
| service.ready | | service.ready | ||
| none | | none | ||
| | | | ||
|- | |||
| ''Out:'' | |||
| service.ready | |||
| app origin | |||
| same as origin in postMessage api | |||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| service.registerHandler | | service.registerHandler | ||
| | | none | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| service.registerHandler | | service.registerHandler | ||
| | | origin, activity and message | ||
| | | all strings used by mediator to call a specific handler (e.g. url, "link.send", "confirm") | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| oauth.call | | oauth.call | ||
| | | results returned by call to oauth endpoint | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| oauth.call | | oauth.call | ||
| | | auth service information, user tokens, url to oauth endpoint, parameters (share data) | ||
| | | for oauth call which are sent to oauth endpoints | ||
|- | |- | ||
| ''In:'' | | ''In:'' | ||
| sendEmail.call | | sendEmail.call | ||
| | | simple success/failure object | ||
| | | | ||
|- | |- | ||
| ''Out:'' | | ''Out:'' | ||
| sendEmail.call | | sendEmail.call | ||
| | | user oauth tokens, share data, recipients list | ||
| | | | ||
|} | |} | ||
=== | === OWA stuff === | ||
OpenWebApps provides the ability for content to install an "app" which may also include a "services" component using the Web Activities APIs. fx-share-addon relies on the Web Activities/services functionality for extensibility. | OpenWebApps provides the ability for content to install an "app" which may also include a "services" component using the Web Activities APIs. fx-share-addon relies on the Web Activities/services functionality for extensibility. | ||
| Line 278: | Line 376: | ||
| manifest data for apps | | manifest data for apps | ||
| sqlite database | | sqlite database | ||
|} | |} | ||
| Line 305: | Line 400: | ||
=== oauthorizer === | === oauthorizer === | ||
OAuthorizer provides simple APIs for initiating OAuth login/authorization flow and calling OAuth version 1 and 2 based APIs. | OAuthorizer provides simple APIs for initiating OAuth login/authorization flow and calling OAuth version 1 and 2 based APIs. In our use of oauthorizer, a service iframe makes a call which is received by the mediator class. The mediator class passes that to oauthorizer which makes the oauth call and returns the response. | ||
* future changes | * future changes | ||
** remove ability to store credentials completely | ** remove ability to store credentials completely | ||
** remove content-available API and make available only to mediated openwebapps | ** remove content-available API and make available only to mediated openwebapps | ||
'''Stored Data:''' | '''Stored Data:''' | ||
While oauthorizer can be used to store OAuth credentials, in our use it does not. | |||
'''Communication with Component Y''' | '''Communication with Component Y''' | ||