Ubuntu.Web.WebView
A webview that can be used to render web content in an application. More...
Import Statement: | import Ubuntu.Web 0.2 |
- Obsolete members
Properties
- alertDialog : component
- beforeUnloadDialog : component
- canGoBack : bool
- canGoForward : bool
- confirmDialog : component
- context : WebContext
- contextModel : QtObject
- contextualActions : ActionList
- filePicker : component
- fullscreen : bool
- icon : url
- incognito : bool
- loadProgress : int
- loading : bool
- navigationHistory : list
- promptDialog : component
- title : string
- url : url
Methods
Detailed Description
Here is a very simple example of how to use a WebView to render a web page:
import QtQuick 2.4 import Ubuntu.Web 0.2 WebView { url: class="string">"http://ubuntu.com" }
The WebView
component defaults to using a shared WebContext
that is shared across all WebView
instances in a given application.
See also SharedWebContext.
Property Documentation
alertDialog : component |
The QML component that will be instantiated to display a JavaScript alert dialog.
See also beforeUnloadDialog.
beforeUnloadDialog : component |
The QML component that will be instantiated to display a JavaScript confirmation when the user initiates a navigation away from the current page, if the page has defined an onBeforeUnload
handler.
See also promptDialog.
canGoBack : bool |
Whether the navigation history has a previous entry to navigate back.
See also canGoForward.
canGoForward : bool |
Whether the navigation history has a next entry to navigate forward.
See also canGoBack.
confirmDialog : component |
The QML component that will be instantiated to display a JavaScript confirmation dialog.
See also beforeUnloadDialog.
context : WebView. By default a shared context is used which should fit most use cases, do not override unless you really need a finer control over the context.
An object that holds the contextual data associated with the current context menu, as well as methods to interact with this data. User-defined contextual actions can use this data to process it when triggered. It has the following properties:
It has the following methods:
When there is no active context menu, See also contextualActions.
A list of actions that the user will be presented with when invoking a context menu (by way of a right click on desktop, or a long press on a touch-enabled device, on an image or a hyperlink). By default the list is empty, and no menu is shown. User-defined actions can access the context model. Example of user-defined actions: import Ubuntu.Components 1.3 import Ubuntu.Web 0.2 WebView { contextualActions: ActionList { Action { text: i18n.tr("Open link in browser") enabled: contextModel && contextModel.linkUrl.toString() onTriggered: Qt.openUrlExternally(contextModel.linkUrl) } } } See also contextModel.
The QML component that will be instantiated to let the user select files when the user clicks an
Whether the current page requested fullscreen display.
The URL of the favicon of the current page.
Whether the WebView is being used in private browsing mode, where no data is persisted across sessions.
The load progress of the current page (as a integer value between 0 and 100). See also loading.
Whether the current page is loading. See also reload.
The navigation history (back/forward entries) stored as a list model with a
The QML component that will be instantiated to display a JavaScript prompt dialog. See also beforeUnloadDialog.
The title of the current page.
The URL of the current page. Method Documentation
Go back one entry in the navigation history. See also goForward.
Go forward one entry in the navigation history. See also goBack.
Load HTML content from memory instead of loading it from a URL. The
Reload the current page. See also stop.
Stop loading the current page. Does nothing if there is no page currently loading. See also loading. |