Confirmed users
45
edits
Evelyn Hung (talk | contribs) No edit summary |
|||
| Line 1: | Line 1: | ||
== Goals == | == Goals == | ||
The widget API allows privileged | The widget API allows privileged application have ability to embed other applications in their own iframe, e.g. homescreen, lockscreen ....etc. | ||
==Use case== | == Use case == | ||
==Proposal== | == Proposal == | ||
===extend manifest.webapp=== | === extend manifest.webapp === | ||
An application exposes its widget view via declaring details of widget in mainfest. | |||
{ | { | ||
| Line 21: | Line 21: | ||
=== embed-widgets {{bug|1005818}} === | === embed-widgets {{bug|1005818}} === | ||
In order to expose to privileged APPs and consider security issue. | In order to expose to privileged APPs and consider security issue. | ||
* "embed-widgets" is a new permission for "mozapp" attribute, it comes from [https://developer.mozilla.org/en-US/Apps/Build/App_permissions#embed-apps 'embed-apps'] but is more restricted. Please refer to [https://wiki.mozilla.org/WebAPI/WidgetAPI#Browser_API next section]. | * "embed-widgets" is a new permission for "mozapp" attribute, it comes from [https://developer.mozilla.org/en-US/Apps/Build/App_permissions#embed-apps 'embed-apps'] but is more restricted. Please refer to [https://wiki.mozilla.org/WebAPI/WidgetAPI#Browser_API next section]. | ||
* Set manifest entry in "widget" attribute. | * Set manifest entry in "widget" attribute. | ||
<iframe mozbrowser=“true" mozapp=“manifestURL" widget=“mywidget1” remote=“true”> | <iframe mozbrowser=“true" mozapp=“manifestURL" widget=“mywidget1” remote=“true”> | ||
=== permission requirements === | === permission requirements === | ||
*embed-widgets | *embed-widgets | ||
| Line 108: | Line 110: | ||
* Does the visibility state of an OOP'ed iframe correspond to its parent? | * Does the visibility state of an OOP'ed iframe correspond to its parent? | ||
** Yes. | ** Yes. | ||
==Q&A== | |||
* Why we don't use 'src' to specify launch path? | |||
** A security concern: widget embedder may embed a file which is not allowed by widget to be opened in widget mode. | |||
* Why we need an app to explicitly expose its widget view? Is there any use case that an app doesn't want to be opened as a widget? | |||
** The app thinks its function can't be performed in widget mode, like lockscreen app or camera app. | |||
** Just doesn't want itself to be embeded by other apps for various concerns, like Facebook app or bank apps. | |||
* So I can't specify a 'src', how to open a bookmarked web page as a widget? Web pages don't have a manifest to expose its widget view. | |||
** No, you can't. We don't have a better solution for "initially" loading a 'http://' path within a widget. However, the topic is under discussion, we are trying to find out a solution. | |||
* Is it possible to navigate to an external link within a widget? | |||
** It should be fine to navigate an external link within a widget because window.location is changed by widget itself under its window context, not caused by the widget embedder. | |||
* May a widget request to enlarge itself to full screen as its app mode? | |||
** No, we don't have a better idea for this case now. Issues like how to force homescreen app to deal with the the resize event requested by widget, how to update mozbrowser iframe attributes to indicate the frame is in app mode... | |||
* Some apps want to app.launch() its app mode while user click its widget, but some want to be enlarged. Is there a way to specify? | |||
** We may introduce an attribute in manifest which tells widget embedder how to process the enlarging behavior. But we have to discuss it with Web API team. | |||
==Bugs== | ==Bugs== | ||