WebAPI/BrowserAPI/Common Subset: Difference between revisions
< WebAPI | BrowserAPI
Jump to navigation
Jump to search
(Create page) |
(Update Mozilla DOM events) |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This wiki page aims to document the difference and common subset of <webview> API provided by various vendors. | This wiki page aims to document the difference and common subset of <webview> API provided by various vendors. | ||
== Mozilla Browser Element == | == API categories == | ||
=== Navigation methods === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! Reload | |||
| reload() | |||
| reload() | |||
| refresh() | |||
|- | |||
! Stop | |||
| stop() | |||
| stop() | |||
| stop() | |||
|- | |||
! Navigate to previous page in history | |||
| goBack() | |||
| back() | |||
| goBack() | |||
|- | |||
! Navigate to next page in history | |||
| goForward() | |||
| forward() | |||
| goForward() | |||
|- | |||
! Can go back? | |||
| getCanGoBack() | |||
| canGoBack() | |||
| canGoBack | |||
|- | |||
! Can go forward? | |||
| getCanGoForward() | |||
| canGoForward() | |||
| canGoForward | |||
|- | |||
! Go to particular history entry | |||
| | |||
| go() | |||
| | |||
|- | |||
! Go to particular URL | |||
| iframe.src | |||
| webview.src | |||
| navigate(), navigateWithHttpRequestMessage(), navigateToLocalStreamUri() | |||
|- | |||
! Load a data URL or string | |||
| iframe.src | |||
| webview.src, loadDataWithBaseUrl() | |||
| navigateToString() | |||
|} | |||
=== Resource Management methods === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! Change visibility state | |||
| setVisible() & setActive() | |||
| | |||
| | |||
|- | |||
! Get visibility state | |||
| getVisible() & getActive() | |||
| | |||
| | |||
|- | |||
! Clear resources | |||
| purgeHistory() | |||
| clearData() | |||
| | |||
|- | |||
! Download on behalf of URL | |||
| download() | |||
| | |||
| | |||
|- | |||
! Inject Script | |||
| | |||
| executeScript() | |||
| invokeScriptAsync() | |||
|- | |||
! Inject CSS | |||
| | |||
| insertCSS() | |||
| | |||
|- | |||
! Get document title | |||
| | |||
| documentTitle | |||
| | |||
|} | |||
=== Event Dispatch methods === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! Mouse Event | |||
| sendMouseEvent() | |||
| | |||
| | |||
|- | |||
! Touch Event | |||
| sendTouchEvent() | |||
| | |||
| | |||
|} | |||
=== Miscellaneous methods === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! Screenshot | |||
| getScreenshot() | |||
| | |||
| capturePreviewToBlobAsync() | |||
|- | |||
! Capture content | |||
| | |||
| captureSelectedContentToDataPackageAsync() | |||
| | |||
|- | |||
! Zooming | |||
| zoom() | |||
| setZoom() | |||
| | |||
|- | |||
! Get current zoom factor | |||
| | |||
| getZoom() | |||
| | |||
|- | |||
! Get content's real dimension | |||
| getContentDimensions() | |||
| | |||
| | |||
|- | |||
! Search content | |||
| | |||
| find() | |||
| | |||
|- | |||
! Stop search content | |||
| | |||
| stopFinding() | |||
| | |||
|- | |||
! Get UserAgent | |||
| | |||
| getUserAgent() | |||
| | |||
|- | |||
! Check if UserAgent is overridden | |||
| | |||
| isUserAgentOverridden() | |||
| | |||
|- | |||
! Override UserAgent | |||
| | |||
| setUserAgentOverride() | |||
| | |||
|- | |||
! Print page | |||
| | |||
| print() | |||
| | |||
|} | |||
=== WebApp methods === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! Indicating a active InputMethod App | |||
| setInputMethodActive() | |||
| | |||
| | |||
|- | |||
! Get process identifier | |||
| | |||
| getProcessId() | |||
| | |||
|- | |||
! Stop a process | |||
| | |||
| terminate() | |||
| | |||
|} | |||
=== Attributes === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! App manifest URL | |||
| mozapp | |||
| | |||
| | |||
|- | |||
! Widget manifest URL | |||
| mozwidget | |||
| | |||
| | |||
|} | |||
=== DOM Events === | |||
{| class="wikitable" width="100%" | |||
|- | |||
! API !! Mozilla !! Google !! Microsoft | |||
|- | |||
! on scroll | |||
| mozbrowserscroll, mozbrowserasyncscroll | |||
| | |||
| | |||
|- | |||
! on scrollview change | |||
| mozbrowserscrollviewchange | |||
| | |||
| | |||
|- | |||
! on scroll area change | |||
| mozbrowserscrollareachanged | |||
| | |||
| | |||
|- | |||
! on manifest change | |||
| mozbrowsermanifestchange | |||
| | |||
| | |||
|- | |||
! on meta change | |||
| mozbrowsermetachange | |||
| | |||
| | |||
|- | |||
! on window.close() | |||
| mozbrowserclose | |||
| close | |||
| | |||
|- | |||
! on WebActivity done | |||
| mozbrowseractivitydone | |||
| | |||
| | |||
|- | |||
! on context menu | |||
| mozbrowsercontextmenu | |||
| | |||
| | |||
|- | |||
! on error to load | |||
| mozbrowsererror | |||
| loadabort | |||
| MSWebViewUnviewableContentIdentified | |||
|- | |||
! on favicon change | |||
| mozbrowsericonchange | |||
| | |||
| | |||
|- | |||
! on load end | |||
| mozbrowserloadend | |||
| loadcommit, contentload | |||
| MSWebViewDOMContentLoaded, MSWebViewFrameDOMContentLoaded, MSWebViewNavigationCompleted, MSWebViewFrameNavigationCompleted | |||
|- | |||
! on load start | |||
| mozbrowserloadstart | |||
| loadstart | |||
| MSWebViewNavigationStart, MSWebViewFrameNavigationStarting | |||
|- | |||
! on load stop | |||
| | |||
| loadstop | |||
| | |||
|- | |||
! on loading | |||
| | |||
| | |||
| MSWebViewContentLoading, MSWebViewFrameContentLoading | |||
|- | |||
! on load redirect | |||
| | |||
| loadredirect | |||
| | |||
|- | |||
! on location change | |||
| mozbrowserlocationchange | |||
| | |||
| | |||
|- | |||
! on window.open() | |||
| mozbrowseropenwindow | |||
| newwindow | |||
| | |||
|- | |||
! on SSL state change | |||
| mozbrowsersecuritychange | |||
| | |||
| | |||
|- | |||
! on prompt (alert, confirm, prompt) | |||
| mozbrowsershowmodalprompt | |||
| dialog | |||
| | |||
|- | |||
! on title change | |||
| mozbrowsertitlechange | |||
| | |||
| | |||
|- | |||
! on selection | |||
| mozbrowserselectionstatechanged | |||
| | |||
| | |||
|- | |||
! on touch caret tap | |||
| mozbrowsertouchcarettap | |||
| | |||
| | |||
|- | |||
! on HTTP auth | |||
| mozbrowserusernameandpasswordrequired | |||
| | |||
| | |||
|- | |||
! on asking permission | |||
| | |||
| permissionrequest | |||
| | |||
|- | |||
! on search engine result | |||
| mozbrowseropensearch | |||
| | |||
| | |||
|- | |||
! After paint | |||
| addNextPaintListener() && removeNextPaintListener() | |||
| | |||
| | |||
|- | |||
! on first paint | |||
| mozbrowserfirstpaint, mozbrowserdocumentfirstpaint | |||
| | |||
| | |||
|- | |||
! When the guest window logs a console message | |||
| | |||
| consolemessage | |||
| | |||
|- | |||
! When the process rendering the guest web content has exited | |||
| | |||
| exit | |||
| | |||
|- | |||
! When new find(content search) result appears | |||
| | |||
| findupdate | |||
| | |||
|- | |||
! When the content is responsive | |||
| | |||
| responsive | |||
| | |||
|- | |||
! When the content is unresponsive | |||
| | |||
| unresponsive | |||
| | |||
|- | |||
! On content size change | |||
| mozbrowserresize | |||
| sizechanged | |||
| | |||
|- | |||
! On zoom factor change | |||
| | |||
| zoomchange | |||
| | |||
|- | |||
! on window.external.notify | |||
| | |||
| | |||
| MSWebViewScriptNotify | |||
|} | |||
== Links == | |||
=== Mozilla Browser Element === | |||
;API doc | ;API doc | ||
: https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API | : https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API | ||
;WebIDL | ;WebIDL | ||
: http://mxr.mozilla.org/mozilla-central/source/dom/webidl/BrowserElement.webidl | : http://mxr.mozilla.org/mozilla-central/source/dom/webidl/BrowserElement.webidl | ||
== Google Webview Element == | === Google Webview Element === | ||
;API doc | ;API doc | ||
: https://developer.chrome.com/apps/tags/webview | : https://developer.chrome.com/apps/tags/webview | ||
== Microsoft Webview Element == | === Microsoft Webview Element === | ||
;API doc | ;API doc | ||
: http://msdn.microsoft.com/en-gb/library/windows/apps/dn301831.aspx | : http://msdn.microsoft.com/en-gb/library/windows/apps/dn301831.aspx |
Latest revision as of 07:48, 14 January 2015
This wiki page aims to document the difference and common subset of <webview> API provided by various vendors.
API categories
API | Mozilla | Microsoft | |
---|---|---|---|
Reload | reload() | reload() | refresh() |
Stop | stop() | stop() | stop() |
Navigate to previous page in history | goBack() | back() | goBack() |
Navigate to next page in history | goForward() | forward() | goForward() |
Can go back? | getCanGoBack() | canGoBack() | canGoBack |
Can go forward? | getCanGoForward() | canGoForward() | canGoForward |
Go to particular history entry | go() | ||
Go to particular URL | iframe.src | webview.src | navigate(), navigateWithHttpRequestMessage(), navigateToLocalStreamUri() |
Load a data URL or string | iframe.src | webview.src, loadDataWithBaseUrl() | navigateToString() |
Resource Management methods
API | Mozilla | Microsoft | |
---|---|---|---|
Change visibility state | setVisible() & setActive() | ||
Get visibility state | getVisible() & getActive() | ||
Clear resources | purgeHistory() | clearData() | |
Download on behalf of URL | download() | ||
Inject Script | executeScript() | invokeScriptAsync() | |
Inject CSS | insertCSS() | ||
Get document title | documentTitle |
Event Dispatch methods
API | Mozilla | Microsoft | |
---|---|---|---|
Mouse Event | sendMouseEvent() | ||
Touch Event | sendTouchEvent() |
Miscellaneous methods
API | Mozilla | Microsoft | |
---|---|---|---|
Screenshot | getScreenshot() | capturePreviewToBlobAsync() | |
Capture content | captureSelectedContentToDataPackageAsync() | ||
Zooming | zoom() | setZoom() | |
Get current zoom factor | getZoom() | ||
Get content's real dimension | getContentDimensions() | ||
Search content | find() | ||
Stop search content | stopFinding() | ||
Get UserAgent | getUserAgent() | ||
Check if UserAgent is overridden | isUserAgentOverridden() | ||
Override UserAgent | setUserAgentOverride() | ||
Print page | print() |
WebApp methods
API | Mozilla | Microsoft | |
---|---|---|---|
Indicating a active InputMethod App | setInputMethodActive() | ||
Get process identifier | getProcessId() | ||
Stop a process | terminate() |
Attributes
API | Mozilla | Microsoft | |
---|---|---|---|
App manifest URL | mozapp | ||
Widget manifest URL | mozwidget |
DOM Events
API | Mozilla | Microsoft | |
---|---|---|---|
on scroll | mozbrowserscroll, mozbrowserasyncscroll | ||
on scrollview change | mozbrowserscrollviewchange | ||
on scroll area change | mozbrowserscrollareachanged | ||
on manifest change | mozbrowsermanifestchange | ||
on meta change | mozbrowsermetachange | ||
on window.close() | mozbrowserclose | close | |
on WebActivity done | mozbrowseractivitydone | ||
on context menu | mozbrowsercontextmenu | ||
on error to load | mozbrowsererror | loadabort | MSWebViewUnviewableContentIdentified |
on favicon change | mozbrowsericonchange | ||
on load end | mozbrowserloadend | loadcommit, contentload | MSWebViewDOMContentLoaded, MSWebViewFrameDOMContentLoaded, MSWebViewNavigationCompleted, MSWebViewFrameNavigationCompleted |
on load start | mozbrowserloadstart | loadstart | MSWebViewNavigationStart, MSWebViewFrameNavigationStarting |
on load stop | loadstop | ||
on loading | MSWebViewContentLoading, MSWebViewFrameContentLoading | ||
on load redirect | loadredirect | ||
on location change | mozbrowserlocationchange | ||
on window.open() | mozbrowseropenwindow | newwindow | |
on SSL state change | mozbrowsersecuritychange | ||
on prompt (alert, confirm, prompt) | mozbrowsershowmodalprompt | dialog | |
on title change | mozbrowsertitlechange | ||
on selection | mozbrowserselectionstatechanged | ||
on touch caret tap | mozbrowsertouchcarettap | ||
on HTTP auth | mozbrowserusernameandpasswordrequired | ||
on asking permission | permissionrequest | ||
on search engine result | mozbrowseropensearch | ||
After paint | addNextPaintListener() && removeNextPaintListener() | ||
on first paint | mozbrowserfirstpaint, mozbrowserdocumentfirstpaint | ||
When the guest window logs a console message | consolemessage | ||
When the process rendering the guest web content has exited | exit | ||
When new find(content search) result appears | findupdate | ||
When the content is responsive | responsive | ||
When the content is unresponsive | unresponsive | ||
On content size change | mozbrowserresize | sizechanged | |
On zoom factor change | zoomchange | ||
on window.external.notify | MSWebViewScriptNotify |
Links
Mozilla Browser Element
- API doc
- https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API
- WebIDL
- http://mxr.mozilla.org/mozilla-central/source/dom/webidl/BrowserElement.webidl