WebAPI/WidgetAPI: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
=== embed-widgets {{bug|1005818}} === | === embed-widgets {{bug|1005818}} === | ||
In order to expose to privileged APPs and consider security issue.<br /> | In order to expose to privileged APPs and consider security issue.<br /> | ||
* "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. | * "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 mozapp="manifesturl" widget="mywidget1"> | <iframe mozapp="manifesturl" widget="mywidget1"> |
Revision as of 09:30, 21 May 2014
Goals
The widget API allows privileged APPs have ability to embed APPs in their own iframe, i.e. homescreen, lockscreen ....etc.
Use case
Proposal
embed-widgets bug 1005818
In order to expose to privileged APPs and consider security issue.
- "embed-widgets" is a new permission for "mozapp" attribute, it comes from 'embed-apps' but is more restricted. Please refer to next section.
- Set manifest entry in "widget" attribute.
<iframe mozapp="manifesturl" widget="mywidget1">
extend manifest.webapp
Declare details of widget in mainfest.
{ name: "MyApp2000", ... widgets: { "mywidget1": { href: "widget.html" positions: ["homescreen", "lockscreen"] description: "This is my cool widget" }, "myotherwidget": { ... } } }
Restriction
Issues under discussion
Browser API
Need to clarify which methods/Events are safe or unsafe.
Safe
- Performance methods
- setVisible()
- getVisible()
- purgeHistory()
- Navigation methods
- reload()
- stop()
- Event methods
- sendMouseEvent()
- sendTouchEvent()
- addNextPaintListener()
- removeNextPaintListener()
- Events
- mozbrowserasyncscroll
- mozbrowserclose
- mozbrowsererror
- mozbrowsericonchange
- mozbrowserloadend
- mozbrowserloadstart
- mozbrowserlocationchange
- mozbrowsertitlechange
- mozbrowseropensearch
Unsafe
- getScreenshot()
- Navigation methods
- getCanGoBack()
- goBack()
- getCanGoForward()
- goForward()
- Events
- mozbrowserusernameandpasswordrequired
- mozbrowseropenwindow (i.e. window.open)
- mozbrowsershowmodalprompt (i.e. alert(), confirm(), prompt())
- mozbrowsercontextmenu
- mozbrowsersecuritychange