WebAPI/WidgetAPI: Difference between revisions

Line 129: Line 129:


==Q&A==
==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?
* 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.
** 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.
** 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?
* 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.
** 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.
** A widget is also an iframe. It follows "X-Frame-Options" restrictions. If a web page declare X-Frame-Options, the widget cannot shows that page.


* May a widget request to enlarge itself to full screen as its app mode?
* May a widget request to enlarge itself to full screen as its app mode?
Line 147: Line 142:
* 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?
* 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.
** 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==
Confirmed users
209

edits