Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
- API Level:
- 9
WebView allows presenting content with embedded web browser, both local files and remote websites.
public class WebView : View, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
- Inheritance
-
- Implements
-
Constructors
Declaration
API Level: 9
View Source
WebView(String, String)
Creates a WebView with locale and time-zone.
Declaration
public WebView(string locale, string timezoneId)
Parameters
Type |
Name |
Description |
String |
locale |
The specified locale
|
String |
timezoneId |
The specified time-zone ID
|
View Source
WebView(String[])
Creates a WebView with an args list.
Declaration
public WebView(string[] args)
Parameters
Type |
Name |
Description |
String[] |
args |
Arguments passed into web engine. The first value of array must be program's name.
|
API Level: 9
Declaration
public WebView(WebView webView)
Parameters
Type |
Name |
Description |
WebView |
webView |
WebView to copy. The copied WebView will point at the same implementation
|
API Level: 9
Fields
Declaration
public static readonly BindableProperty CacheModelProperty
Field Value
View Source
CookieAcceptPolicyProperty
CookieAcceptPolicyProperty
Declaration
public static readonly BindableProperty CookieAcceptPolicyProperty
Field Value
Declaration
public static readonly BindableProperty DefaultFontSizeProperty
Field Value
View Source
DefaultTextEncodingNameProperty
DefaultTextEncodingNameProperty
Declaration
public static readonly BindableProperty DefaultTextEncodingNameProperty
Field Value
Declaration
public static readonly BindableProperty EnableJavaScriptProperty
Field Value
View Source
LoadImagesAutomaticallyProperty
LoadImagesAutomaticallyProperty
Declaration
public static readonly BindableProperty LoadImagesAutomaticallyProperty
Field Value
Properties
Declaration
public WebBackForwardList BackForwardList { get; }
Property Value
View Source
CacheModel
Deprecated. The cache model of the current WebView.
Declaration
public CacheModel CacheModel { get; set; }
Property Value
View Source
ContentBackgroundColor
Background color of web page.
Please note that it only works after LoadUrl, etc.
Declaration
public Color ContentBackgroundColor { get; set; }
Property Value
View Source
ContentSize
The size of content, read-only.
Declaration
public Size ContentSize { get; }
Property Value
Declaration
public WebContext Context { get; }
Property Value
View Source
CookieAcceptPolicy
Deprecated. The cookie acceptance policy.
Declaration
public CookieAcceptPolicy CookieAcceptPolicy { get; set; }
Property Value
Declaration
public WebCookieManager CookieManager { get; }
Property Value
View Source
CursorEnabledByClient
Whether cursor is enabled or not by client.
Declaration
public bool CursorEnabledByClient { get; set; }
Property Value
View Source
DefaultFontSize
The default font size in pixel.
Declaration
public int DefaultFontSize { get; set; }
Property Value
View Source
DefaultTextEncodingName
The default text encoding name.
e.g. "UTF-8"
Declaration
public string DefaultTextEncodingName { get; set; }
Property Value
View Source
EnableJavaScript
Deprecated. Whether JavaScript is enabled.
Declaration
public bool EnableJavaScript { get; set; }
Property Value
Declaration
public ImageView Favicon { get; }
Property Value
API Level: 9
View Source
KeyEventsEnabled
Whether key events are enabled or not.
Declaration
public bool KeyEventsEnabled { get; set; }
Property Value
View Source
LoadImagesAutomatically
Deprecated. Whether images can be loaded automatically.
Declaration
public bool LoadImagesAutomatically { get; set; }
Property Value
View Source
LoadProgressPercentage
Gets percentage of loading progress.
Declaration
public float LoadProgressPercentage { get; }
Property Value
API Level: 9
View Source
MouseEventsEnabled
Whether mouse events are enabled or not.
Declaration
public bool MouseEventsEnabled { get; set; }
Property Value
Declaration
public float PageZoomFactor { get; set; }
Property Value
Declaration
public Position ScrollPosition { get; set; }
Property Value
Declaration
public Size ScrollSize { get; }
Property Value
View Source
SelectedText
Gets selected text in web page.
Declaration
public string SelectedText { get; }
Property Value
Declaration
public WebSettings Settings { get; }
Property Value
View Source
TextZoomFactor
Zoom factor of text in web page.
Declaration
public float TextZoomFactor { get; set; }
Property Value
View Source
TileCoverAreaMultiplier
Multiplier of cover area of tile when web page is rendered.
Declaration
public float TileCoverAreaMultiplier { get; set; }
Property Value
View Source
TilesClearedWhenHidden
Whether tiles are cleared or not when hidden.
Declaration
public bool TilesClearedWhenHidden { get; set; }
Property Value
Declaration
public string Title { get; }
Property Value
API Level: 9
Declaration
public string Url { get; set; }
Property Value
API Level: 9
Declaration
public string UserAgent { get; set; }
Property Value
API Level: 9
View Source
VideoHoleEnabled
Whether video hole is enabled or not.
Declaration
public bool VideoHoleEnabled { get; set; }
Property Value
Methods
View Source
ActivateAccessibility(Boolean)
Requests to activate/deactivate the accessibility usage set by web app.
Declaration
public void ActivateAccessibility(bool activated)
Parameters
Type |
Name |
Description |
Boolean |
activated |
The new factor to be scaled
|
Declaration
public bool AddCustomHeader(string name, string value)
Parameters
Type |
Name |
Description |
String |
name |
The name of custom header
|
String |
value |
The value of custom header
|
Returns
View Source
AddDynamicCertificatePath(String, String)
Adds dynamic certificate path.
Declaration
public void AddDynamicCertificatePath(string host, string certPath)
Parameters
Type |
Name |
Description |
String |
host |
Host that required client authentication
|
String |
certPath |
The file path stored certificate
|
View Source
AddJavaScriptMessageHandler(String, WebView.JavaScriptMessageHandler)
Add a message handler into the WebView.
Declaration
public void AddJavaScriptMessageHandler(string objectName, WebView.JavaScriptMessageHandler handler)
Parameters
View Source
CanGoBack()
Returns whether backward is possible.
Declaration
Returns
Type |
Description |
Boolean |
True if backward is possible, false otherwise
|
View Source
CanGoForward()
Returns whether forward is possible.
Declaration
public bool CanGoForward()
Returns
Type |
Description |
Boolean |
True if forward is possible, false otherwise
|
View Source
CheckVideoPlayingAsynchronously(WebView.VideoPlayingCallback)
Asynchronously requests to check if there is a video playing in the given view.
Declaration
public bool CheckVideoPlayingAsynchronously(WebView.VideoPlayingCallback callback)
Parameters
Returns
View Source
ClearAllTilesResources()
Clears title resources of current WebView.
Declaration
public void ClearAllTilesResources()
View Source
ClearCache()
Deprecated. Clears the cache of current WebView.
Declaration
View Source
ClearCookies()
Deprecated. Clears all the cookies of current WebView.
Declaration
public void ClearCookies()
View Source
ClearHistory()
Clears the history of current WebView.
Declaration
public void ClearHistory()
View Source
Dispose(DisposeTypes)
Dispose for IDisposable pattern
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Overrides
View Source
EvaluateJavaScript(String)
Evaluates JavaScript code represented as a string.
Declaration
public void EvaluateJavaScript(string script)
Parameters
Type |
Name |
Description |
String |
script |
The JavaScript code
|
View Source
EvaluateJavaScript(String, WebView.JavaScriptMessageHandler)
Evaluates JavaScript code represented as a string.
Declaration
public void EvaluateJavaScript(string script, WebView.JavaScriptMessageHandler handler)
Parameters
View Source
GetPlainTextAsynchronously(WebView.PlainTextReceivedCallback)
Get a plain text of current web page asynchronously.
Please note that it gets plain text of currently loaded page so please call this method after page load finished.
Declaration
public void GetPlainTextAsynchronously(WebView.PlainTextReceivedCallback callback)
Parameters
View Source
GetScaleFactor()
Gets the current scale factor of the page.
Declaration
public float GetScaleFactor()
Returns
View Source
GetScreenshot(Rectangle, Single)
Get snapshot of the specified viewArea of page.
Declaration
public ImageView GetScreenshot(Rectangle viewArea, float scaleFactor)
Parameters
Type |
Name |
Description |
Rectangle |
viewArea |
Host that required client authentication
|
Single |
scaleFactor |
The file path stored certificate
|
Returns
View Source
GetScreenshotAsynchronously(Rectangle, Single, WebView.ScreenshotAcquiredCallback)
Get snapshot of the specified viewArea of page.
Declaration
public bool GetScreenshotAsynchronously(Rectangle viewArea, float scaleFactor, WebView.ScreenshotAcquiredCallback callback)
Parameters
Returns
Declaration
Declaration
View Source
HighlightText(String, WebView.FindOption, UInt32)
Searches and highlights the given string in the document.
Declaration
public bool HighlightText(string text, WebView.FindOption options, uint maxMatchCount)
Parameters
Type |
Name |
Description |
String |
text |
The text to be searched
|
WebView.FindOption |
options |
The options to search
|
UInt32 |
maxMatchCount |
The maximum match count to search
|
Returns
View Source
HitTest(Int32, Int32, WebView.HitTestMode)
Does hit test synchronously.
Declaration
public WebHitTestResult HitTest(int x, int y, WebView.HitTestMode mode)
Parameters
Type |
Name |
Description |
Int32 |
x |
the horizontal position to query
|
Int32 |
y |
the vertical position to query
|
WebView.HitTestMode |
mode |
the mode of hit test
|
Returns
View Source
HitTestAsynchronously(Int32, Int32, WebView.HitTestMode, WebView.HitTestFinishedCallback)
Does hit test asynchronously.
Declaration
public bool HitTestAsynchronously(int x, int y, WebView.HitTestMode mode, WebView.HitTestFinishedCallback callback)
Parameters
Returns
Declaration
public void JavaScriptAlertReply()
Declaration
public void JavaScriptConfirmReply(bool confirmed)
Parameters
Type |
Name |
Description |
Boolean |
confirmed |
Confirmed or not
|
Declaration
public void JavaScriptPromptReply(string result)
Parameters
Type |
Name |
Description |
String |
result |
Text in prompt input field.
|
View Source
LoadContents(Byte[], String, String, String)
Requests to load the given contents by MIME type.
Declaration
public bool LoadContents(byte[] contents, string mimeType, string encoding, string baseUri)
Parameters
Type |
Name |
Description |
Byte[] |
contents |
The contents to be loaded in bytes
|
String |
mimeType |
The type of contents, "text/html" is assumed if null
|
String |
encoding |
The encoding for contents, "UTF-8" is assumed if null
|
String |
baseUri |
The base URI to use for relative resources
|
Returns
View Source
LoadContents(String, UInt32, String, String, String)
Requests to load the given contents by MIME type.
Declaration
public bool LoadContents(string contents, uint contentSize, string mimeType, string encoding, string baseUri)
Parameters
Type |
Name |
Description |
String |
contents |
The contents to be loaded. For UTF-8 encoding, contents would be got like System.Text.Encoding.UTF8.GetString(...)
|
UInt32 |
contentSize |
The size of contents (in bytes)
|
String |
mimeType |
The type of contents, "text/html" is assumed if null
|
String |
encoding |
The encoding for contents, "UTF-8" is assumed if null
|
String |
baseUri |
The base URI to use for relative resources
|
Returns
Declaration
public void LoadHtmlString(string data)
Parameters
Type |
Name |
Description |
String |
data |
The data of Web
|
API Level: 9
View Source
LoadHTMLString(String)
Deprecated. Loads a html by string.
Declaration
public void LoadHTMLString(string data)
Parameters
Type |
Name |
Description |
String |
data |
The data of Web
|
View Source
LoadHtmlStringOverrideCurrentEntry(String, String, String)
Loads the specified html as the content of the view to override current history entry.
Declaration
public bool LoadHtmlStringOverrideCurrentEntry(string html, string baseUri, string unreachableUri)
Parameters
Type |
Name |
Description |
String |
html |
The html to be loaded
|
String |
baseUri |
Base URL used for relative paths to external objects
|
String |
unreachableUri |
URL that could not be reached
|
Returns
Declaration
public void LoadUrl(string url)
Parameters
Type |
Name |
Description |
String |
url |
The path of Web
|
API Level: 9
View Source
RegisterGeolocationPermissionCallback(WebView.GeolocationPermissionCallback)
Registers callback which will be called upon geolocation permission request.
Declaration
public void RegisterGeolocationPermissionCallback(WebView.GeolocationPermissionCallback callback)
Parameters
View Source
RegisterJavaScriptAlertCallback(WebView.JavaScriptAlertCallback)
Registers a callback for JS alert.
Declaration
public void RegisterJavaScriptAlertCallback(WebView.JavaScriptAlertCallback callback)
Parameters
View Source
RegisterJavaScriptConfirmCallback(WebView.JavaScriptConfirmCallback)
Registers a callback for JS confirm.
Declaration
public void RegisterJavaScriptConfirmCallback(WebView.JavaScriptConfirmCallback callback)
Parameters
View Source
RegisterJavaScriptPromptCallback(WebView.JavaScriptPromptCallback)
Registers a callback for JS promt.
Declaration
public void RegisterJavaScriptPromptCallback(WebView.JavaScriptPromptCallback callback)
Parameters
View Source
ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)
Declaration
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type |
Name |
Description |
Tizen.System.Runtime.InteropServices.HandleRef |
swigCPtr |
|
Overrides
Declaration
View Source
ReloadWithoutCache()
Reloads the current page's document without cache
Declaration
public bool ReloadWithoutCache()
Returns
Declaration
public bool RemoveCustomHeader(string name)
Parameters
Type |
Name |
Description |
String |
name |
The name of custom header
|
Returns
View Source
Resume()
Resumes the operation after calling Suspend()
Declaration
View Source
ResumeNetworkLoading()
Resumes all network loading.
Declaration
public void ResumeNetworkLoading()
View Source
Scrolls page of web view by deltaX and detlaY.
Declaration
public void ScrollBy(int deltaX, int deltaY)
Parameters
Type |
Name |
Description |
Int32 |
deltaX |
The deltaX of scroll
|
Int32 |
deltaY |
The deltaY of scroll
|
View Source
Scrolls edge of web view by deltaX and deltaY.
Declaration
public bool ScrollEdgeBy(int deltaX, int deltaY)
Parameters
Type |
Name |
Description |
Int32 |
deltaX |
The deltaX of scroll
|
Int32 |
deltaY |
The deltaY of scroll
|
Returns
View Source
SetScaleFactor(Single, Vector2)
Scales the current page, centered at the given point.
Declaration
public void SetScaleFactor(float scaleFactor, Vector2 point)
Parameters
Type |
Name |
Description |
Single |
scaleFactor |
The new factor to be scaled
|
Vector2 |
point |
The center coordinate
|
View Source
SetTtsFocus(Boolean)
Sets the tts focus to the webview.
Please note that it only works when the webview does not have keyinput focus.
If the webview has a keyinput focus, it also has tts focus so calling SetTtsFocus(false) is ignored.
Declaration
public void SetTtsFocus(bool focused)
Parameters
Type |
Name |
Description |
Boolean |
focused |
Focused or not
|
View Source
StartInspectorServer(UInt32)
Starts the inspector server.
Declaration
public uint StartInspectorServer(uint port)
Parameters
Type |
Name |
Description |
UInt32 |
port |
The port number
|
Returns
View Source
StopInspectorServer()
Stops the inspector server.
Declaration
public bool StopInspectorServer()
Returns
Declaration
public void StopLoading()
Declaration
View Source
SuspendNetworkLoading()
Suspends all network loading.
Declaration
public void SuspendNetworkLoading()
Events
View Source
CertificateConfirmed
Event for the CertificateConfirmed signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when certificate would be confirmed.
Declaration
public event EventHandler<WebViewCertificateReceivedEventArgs> CertificateConfirmed
Event Type
View Source
ConsoleMessageReceived
Event for the ConsoleMessageReceived signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when console message is received.
Declaration
public event EventHandler<WebViewConsoleMessageReceivedEventArgs> ConsoleMessageReceived
Event Type
View Source
Event for the ContextMenuHidden signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when context menu item is hidden.
Declaration
public event EventHandler<WebViewContextMenuHiddenEventArgs> ContextMenuHidden
Event Type
View Source
Event for the ContextMenuShown signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when context menu is shown.
Declaration
public event EventHandler<WebViewContextMenuShownEventArgs> ContextMenuShown
Event Type
View Source
FormRepostPolicyDecided
Event for the FormRepostDecided signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when form repost policy would be decided.
Declaration
public event EventHandler<WebViewFormRepostPolicyDecidedEventArgs> FormRepostPolicyDecided
Event Type
View Source
FrameRendered
Event for the FrameRendered signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when frame is rendered off-screen.
Declaration
public event EventHandler<EventArgs> FrameRendered
Event Type
Type |
Description |
EventHandler<EventArgs> |
|
View Source
HttpAuthRequested
Event for the HttpAuthRequested signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when http authentication is requested.
Declaration
public event EventHandler<WebViewHttpAuthRequestedEventArgs> HttpAuthRequested
Event Type
View Source
NavigationPolicyDecided
Event for the NavigationPolicyDecided signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when response policy would be decided.
Declaration
public event EventHandler<WebViewPolicyDecidedEventArgs> NavigationPolicyDecided
Event Type
View Source
NewWindowCreated
Event for the NewWindowCreated signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when a new window would be created.
Declaration
public event EventHandlerWithReturnType<object, EventArgs, WebView> NewWindowCreated
Event Type
View Source
PageLoadError
Event for the PageLoadError signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when there's an error in page loading.
Declaration
public event EventHandler<WebViewPageLoadErrorEventArgs> PageLoadError
Event Type
API Level: 9
View Source
PageLoadFinished
Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when page loading has finished.
Declaration
public event EventHandler<WebViewPageLoadEventArgs> PageLoadFinished
Event Type
API Level: 9
View Source
PageLoading
Event for the PageLoading signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when page loading is in progress.
Declaration
public event EventHandler<WebViewPageLoadEventArgs> PageLoading
Event Type
API Level: 9
View Source
PageLoadStarted
Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when page loading has started.
Declaration
public event EventHandler<WebViewPageLoadEventArgs> PageLoadStarted
Event Type
API Level: 9
View Source
ResponsePolicyDecided
Event for the ResponsePolicyDecided signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when response policy would be decided.
Declaration
public event EventHandler<WebViewPolicyDecidedEventArgs> ResponsePolicyDecided
Event Type
View Source
Event for the ScrollEdgeReached signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when web view is scrolled to edge.
Declaration
public event EventHandler<WebViewScrollEdgeReachedEventArgs> ScrollEdgeReached
Event Type
View Source
SslCertificateChanged
Event for the SslCertificateChanged signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when SSL certificate is changed.
Declaration
public event EventHandler<WebViewCertificateReceivedEventArgs> SslCertificateChanged
Event Type
View Source
UrlChanged
Event for the UrlChanged signal which can be used to subscribe or unsubscribe the event handler.
This signal is emitted when url is changed.
Declaration
public event EventHandler<WebViewUrlChangedEventArgs> UrlChanged
Event Type
Implements
Extension Methods