gi-webkit2-4.0.11: WebKit2 bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.WebKit2.Objects.WebView

Contents

Description

 

Synopsis

Exported types

Methods

canExecuteEditingCommand

webViewCanExecuteEditingCommand Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) 
=> a

webView: a WebView

-> Text

command: the command to check

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously execute the given editing command.

When the operation is finished, callback will be called. You can then call webViewCanExecuteEditingCommandFinish to get the result of the operation.

canExecuteEditingCommandFinish

webViewCanExecuteEditingCommandFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m ()

(Can throw GError)

Finish an asynchronous operation started with webViewCanExecuteEditingCommand.

canGoBack

webViewCanGoBack Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Bool

Returns: True if able to move back or False otherwise.

Determines whether webView has a previous history item.

canGoForward

webViewCanGoForward Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Bool

Returns: True if able to move forward or False otherwise.

Determines whether webView has a next history item.

canShowMimeType

webViewCanShowMimeType Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

mimeType: a MIME type

-> m Bool

Returns: True if the MIME type mimeType can be displayed or False otherwise

Whether or not a MIME type can be displayed in webView.

downloadUri

webViewDownloadUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

uri: the URI to download

-> m Download

Returns: a new Download representing the the download operation.

Requests downloading of the specified URI string for webView.

executeEditingCommand

webViewExecuteEditingCommand Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

command: the command to execute

-> m () 

Request to execute the given command for webView. You can use webViewCanExecuteEditingCommand to check whether it's possible to execute the command.

executeEditingCommandWithArgument

webViewExecuteEditingCommandWithArgument Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

command: the command to execute

-> Text

argument: the command argument

-> m () 

Request to execute the given command with argument for webView. You can use webViewCanExecuteEditingCommand to check whether it's possible to execute the command.

Since: 2.10

getBackForwardList

webViewGetBackForwardList Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m BackForwardList

Returns: the BackForwardList

Obtains the BackForwardList associated with the given WebView. The BackForwardList is owned by the WebView.

getBackgroundColor

webViewGetBackgroundColor Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m RGBA 

Gets the color that is used to draw the webView background before the actual contents are rendered. For more information see also webViewSetBackgroundColor

Since: 2.8

getContext

webViewGetContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m WebContext

Returns: the WebContext of the view

Gets the web context of webView.

getCustomCharset

webViewGetCustomCharset Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Text

Returns: the current custom character encoding name or Nothing if no custom character encoding has been set.

Returns the current custom character encoding name of webView.

getEditorState

webViewGetEditorState Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m EditorState

Returns: the EditorState of the view

Gets the web editor state of webView.

Since: 2.10

getEstimatedLoadProgress

webViewGetEstimatedLoadProgress Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Double

Returns: an estimate of the of the percent complete for a document load as a range from 0.0 to 1.0.

Gets the value of the WebView:estimated-load-progress property. You can monitor the estimated progress of a load operation by connecting to the notify::estimated-load-progress signal of webView.

getFavicon

webViewGetFavicon Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Surface

Returns: a pointer to a Surface with the favicon or Nothing if there's no icon associated with webView.

Returns favicon currently associated to webView, if any. You can connect to notify::favicon signal of webView to be notified when the favicon is available.

getFindController

webViewGetFindController Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: the WebView

-> m FindController

Returns: the FindController associated to this particular WebView.

Gets the FindController that will allow the caller to query the WebView for the text to look for.

getInspector

webViewGetInspector Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m WebInspector

Returns: the WebInspector of webView

Get the WebInspector associated to webView

getJavascriptGlobalContext

webViewGetJavascriptGlobalContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m GlobalContext

Returns: the <function>JSGlobalContextRef</function> used by webView to deserialize the result values of scripts.

Get the global JavaScript context used by webView to deserialize the result values of scripts executed with webViewRunJavascript.

getMainResource

webViewGetMainResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m WebResource

Returns: the main WebResource of the view or Nothing if nothing has been loaded.

Return the main resource of webView.

getPageId

webViewGetPageId Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Word64

Returns: the page ID of webView.

Get the identifier of the WebKitWebPage corresponding to the WebView

getSessionState

webViewGetSessionState Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m WebViewSessionState

Returns: a WebViewSessionState

Gets the current session state of webView

Since: 2.12

getSettings

webViewGetSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Settings

Returns: the Settings attached to webView

Gets the Settings currently applied to webView. If no other Settings have been explicitly applied to webView with webViewSetSettings, the default Settings will be returned. This method always returns a valid Settings object. To modify any of the webView settings, you can either create a new Settings object with settingsNew, setting the desired preferences, and then replace the existing webView settings with webViewSetSettings or get the existing webView settings and update it directly. Settings objects can be shared by multiple WebView<!-- -->s, so modifying the settings of a WebView would affect other WebView<!-- -->s using the same Settings.

getSnapshot

webViewGetSnapshot Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) 
=> a

webView: a WebView

-> SnapshotRegion

region: the SnapshotRegion for this snapshot

-> [SnapshotOptions]

options: SnapshotOptions for the snapshot

-> Maybe b

cancellable: a Cancellable

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback

-> m () 

Asynchronously retrieves a snapshot of webView for region. options specifies how the snapshot should be rendered.

When the operation is finished, callback will be called. You must call webViewGetSnapshotFinish to get the result of the operation.

getSnapshotFinish

webViewGetSnapshotFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m Surface

Returns: a Surface with the retrieved snapshot or Nothing in error. (Can throw GError)

Finishes an asynchronous operation started with webViewGetSnapshot.

getTitle

data WebViewGetTitleMethodInfo Source #

Instances

((~) * signature (m Text), MonadIO m, IsWebView a) => MethodInfo * WebViewGetTitleMethodInfo a signature Source # 

webViewGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Text

Returns: The main frame document title of webView.

Gets the value of the WebView:title property. You can connect to notify::title signal of webView to be notified when the title has been received.

getTlsInfo

webViewGetTlsInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m (Bool, TlsCertificate, [TlsCertificateFlags])

Returns: True if the webView connection uses HTTPS and a response has been received from the server, or False otherwise.

Retrieves the TlsCertificate associated with the main resource of webView, and the TlsCertificateFlags showing what problems, if any, have been found with that certificate. If the connection is not HTTPS, this function returns False. This function should be called after a response has been received from the server, so you can connect to WebView::load-changed and call this function when it's emitted with LoadEventCommitted event.

Note that this function provides no information about the security of the web page if the current TLSErrorsPolicy is wEBKITTLSERRORSPOLICYIGNORE, as subresources of the page may be controlled by an attacker. This function may safely be used to determine the security status of the current page only if the current TLSErrorsPolicy is wEBKITTLSERRORSPOLICYFAIL, in which case subresources that fail certificate verification will be blocked.

getUri

data WebViewGetUriMethodInfo Source #

Instances

((~) * signature (m (Maybe Text)), MonadIO m, IsWebView a) => MethodInfo * WebViewGetUriMethodInfo a signature Source # 

webViewGetUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m (Maybe Text)

Returns: the current active URI of webView or Nothing if nothing has been loaded yet.

Returns the current active URI of webView. The active URI might change during a load operation:

<orderedlist> <listitem><para> When nothing has been loaded yet on webView the active URI is Nothing. </para></listitem> <listitem><para> When a new load operation starts the active URI is the requested URI: <itemizedlist> <listitem><para> If the load operation was started by webViewLoadUri, the requested URI is the given one. </para></listitem> <listitem><para> If the load operation was started by webViewLoadHtml, the requested URI is "about:blank". </para></listitem> <listitem><para> If the load operation was started by webViewLoadAlternateHtml, the requested URI is content URI provided. </para></listitem> <listitem><para> If the load operation was started by webViewGoBack or webViewGoForward, the requested URI is the original URI of the previous/next item in the BackForwardList of webView. </para></listitem> <listitem><para> If the load operation was started by webViewGoToBackForwardListItem, the requested URI is the opriginal URI of the given BackForwardListItem. </para></listitem> </itemizedlist> </para></listitem> <listitem><para> If there is a server redirection during the load operation, the active URI is the redirected URI. When the signal WebView::load-changed is emitted with LoadEventRedirected event, the active URI is already updated to the redirected URI. </para></listitem> <listitem><para> When the signal WebView::load-changed is emitted with LoadEventCommitted event, the active URI is the final one and it will not change unless a new load operation is started or a navigation action within the same page is performed. </para></listitem> </orderedlist>

You can monitor the active URI by connecting to the notify::uri signal of webView.

getUserContentManager

webViewGetUserContentManager Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m UserContentManager

Returns: the UserContentManager associated with the view

Gets the user content manager associated to webView, or Nothing if the view does not have an user content manager.

Since: 2.6

getWindowProperties

webViewGetWindowProperties Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m WindowProperties

Returns: the WindowProperties of webView

Get the WindowProperties object containing the properties that the window containing webView should have.

getZoomLevel

webViewGetZoomLevel Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Double

Returns: the current zoom level of webView

Get the zoom level of webView, i.e. the factor by which the view contents are scaled with respect to their original size.

goBack

data WebViewGoBackMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewGoBackMethodInfo a signature Source # 

webViewGoBack Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Loads the previous history item. You can monitor the load operation by connecting to WebView::load-changed signal.

goForward

data WebViewGoForwardMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewGoForwardMethodInfo a signature Source # 

webViewGoForward Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Loads the next history item. You can monitor the load operation by connecting to WebView::load-changed signal.

goToBackForwardListItem

webViewGoToBackForwardListItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsBackForwardListItem b) 
=> a

webView: a WebView

-> b

listItem: a BackForwardListItem

-> m () 

Loads the specific history item listItem. You can monitor the load operation by connecting to WebView::load-changed signal.

isEditable

webViewIsEditable :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool Source #

No description available in the introspection data.

isLoading

webViewIsLoading Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Bool

Returns: True if webView is loading a page or False otherwise.

Gets the value of the WebView:is-loading property. You can monitor when a WebView is loading a page by connecting to notify::is-loading signal of webView. This is useful when you are interesting in knowing when the view is loding something but not in the details about the status of the load operation, for example to start a spinner when the view is loading a page and stop it when it finishes.

isPlayingAudio

webViewIsPlayingAudio Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m Bool

Returns: True if a page in webView is playing audio or False otherwise.

Gets the value of the WebView:is-playing-audio property. You can monitor when a page in a WebView is playing audio by connecting to the notify::is-playing-audio signal of webView. This is useful when the application wants to provide visual feedback when a page is producing sound.

Since: 2.8

loadAlternateHtml

webViewLoadAlternateHtml Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

content: the new content to display as the main page of the webView

-> Text

contentUri: the URI for the alternate page content

-> Maybe Text

baseUri: the base URI for relative locations or Nothing

-> m () 

Load the given content string for the URI contentUri. This allows clients to display page-loading errors in the WebView itself. When this method is called from WebView::load-failed signal to show an error page, the the back-forward list is maintained appropriately. For everything else this method works the same way as webViewLoadHtml.

loadBytes

data WebViewLoadBytesMethodInfo Source #

Instances

((~) * signature (Bytes -> Maybe Text -> Maybe Text -> Maybe Text -> m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewLoadBytesMethodInfo a signature Source # 

webViewLoadBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Bytes

bytes: input data to load

-> Maybe Text

mimeType: the MIME type of bytes, or Nothing

-> Maybe Text

encoding: the character encoding of bytes, or Nothing

-> Maybe Text

baseUri: the base URI for relative locations or Nothing

-> m () 

Load the specified bytes into webView using the given mimeType and encoding. When mimeType is Nothing, it defaults to "text/html". When encoding is Nothing, it defaults to "UTF-8". When baseUri is Nothing, it defaults to "about:blank". You can monitor the load operation by connecting to WebView::load-changed signal.

Since: 2.6

loadHtml

data WebViewLoadHtmlMethodInfo Source #

Instances

((~) * signature (Text -> Maybe Text -> m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewLoadHtmlMethodInfo a signature Source # 

webViewLoadHtml Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

content: The HTML string to load

-> Maybe Text

baseUri: The base URI for relative locations or Nothing

-> m () 

Load the given content string with the specified baseUri. If baseUri is not Nothing, relative URLs in the content will be resolved against baseUri and absolute local paths must be children of the baseUri. For security reasons absolute local paths that are not children of baseUri will cause the web process to terminate. If you need to include URLs in content that are local paths in a different directory than baseUri you can build a data URI for them. When baseUri is Nothing, it defaults to "about:blank". The mime type of the document will be "text/html". You can monitor the load operation by connecting to WebView::load-changed signal.

loadPlainText

webViewLoadPlainText Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

plainText: The plain text to load

-> m () 

Load the specified plainText string into webView. The mime type of document will be "text/plain". You can monitor the load operation by connecting to WebView::load-changed signal.

loadRequest

data WebViewLoadRequestMethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsWebView a, IsURIRequest b) => MethodInfo * WebViewLoadRequestMethodInfo a signature Source # 

webViewLoadRequest Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsURIRequest b) 
=> a

webView: a WebView

-> b

request: a URIRequest to load

-> m () 

Requests loading of the specified URIRequest. You can monitor the load operation by connecting to WebView::load-changed signal.

loadUri

data WebViewLoadUriMethodInfo Source #

Instances

((~) * signature (Text -> m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewLoadUriMethodInfo a signature Source # 

webViewLoadUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Text

uri: an URI string

-> m () 

Requests loading of the specified URI string. You can monitor the load operation by connecting to WebView::load-changed signal.

new

webViewNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m WebView

Returns: The newly created WebView widget

Creates a new WebView with the default WebContext and no UserContentManager associated with it. See also webViewNewWithContext, webViewNewWithUserContentManager, and webViewNewWithSettings.

newWithContext

webViewNewWithContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebContext a) 
=> a

context: the WebContext to be used by the WebView

-> m WebView

Returns: The newly created WebView widget

Creates a new WebView with the given WebContext and no UserContentManager associated with it. See also webViewNewWithUserContentManager and webViewNewWithSettings.

newWithRelatedView

webViewNewWithRelatedView Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: the related WebView

-> m Widget

Returns: The newly created WebView widget

Creates a new WebView sharing the same web process with webView. This method doesn't have any effect when ProcessModelSharedSecondaryProcess process model is used, because a single web process is shared for all the web views in the same WebContext. When using ProcessModelMultipleSecondaryProcesses process model, this method should always be used when creating the WebView in the WebView::create signal. You can also use this method to implement other process models based on ProcessModelMultipleSecondaryProcesses, like for example, sharing the same web process for all the views in the same security domain.

The newly created WebView will also have the same UserContentManager and Settings as webView.

Since: 2.4

newWithSettings

webViewNewWithSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsSettings a) 
=> a

settings: a Settings

-> m WebView

Returns: The newly created WebView widget

Creates a new WebView with the given Settings. See also webViewNewWithContext, and webViewNewWithUserContentManager.

Since: 2.6

newWithUserContentManager

webViewNewWithUserContentManager Source #

Arguments

:: (HasCallStack, MonadIO m, IsUserContentManager a) 
=> a

userContentManager: a UserContentManager.

-> m WebView

Returns: The newly created WebView widget

Creates a new WebView with the given UserContentManager. The content loaded in the view may be affected by the content injected in the view by the user content manager.

Since: 2.6

reload

data WebViewReloadMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewReloadMethodInfo a signature Source # 

webViewReload Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Reloads the current contents of webView. See also webViewReloadBypassCache.

reloadBypassCache

webViewReloadBypassCache Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Reloads the current contents of webView without using any cached data.

restoreSessionState

webViewRestoreSessionState Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> WebViewSessionState

state: a WebViewSessionState

-> m () 

Restore the webView session state from state

Since: 2.12

runJavascript

webViewRunJavascript Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) 
=> a

webView: a WebView

-> Text

script: the script to run

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the script finished

-> m () 

Asynchronously run script in the context of the current page in webView. If WebKitWebSettings:enable-javascript is FALSE, this method will do nothing.

When the operation is finished, callback will be called. You can then call webViewRunJavascriptFinish to get the result of the operation.

runJavascriptFinish

webViewRunJavascriptFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m JavascriptResult

Returns: a JavascriptResult with the result of the last executed statement in script or Nothing in case of error (Can throw GError)

Finish an asynchronous operation started with webViewRunJavascript.

This is an example of using webViewRunJavascript with a script returning a string:

<informalexample><programlisting> static void web_view_javascript_finished (GObject *object, GAsyncResult *result, gpointer user_data) { WebKitJavascriptResult *js_result; JSValueRef value; JSGlobalContextRef context; GError *error = NULL;

js_result = webkit_web_view_run_javascript_finish (WEBKIT_WEB_VIEW (object), result, &error); if (!js_result) { g_warning ("Error running javascript: s", error->message); g_error_free (error); return; }

context = webkit_javascript_result_get_global_context (js_result); value = webkit_javascript_result_get_value (js_result); if (JSValueIsString (context, value)) { JSStringRef js_str_value; gchar *str_value; gsize str_length;

js_str_value = JSValueToStringCopy (context, value, NULL); str_length = JSStringGetMaximumUTF8CStringSize (js_str_value); str_value = (gchar *)g_malloc (str_length); JSStringGetUTF8CString (js_str_value, str_value, str_length); JSStringRelease (js_str_value); g_print ("Script result: s\n", str_value); g_free (str_value); } else { g_warning ("Error running javascript: unexpected return value"); } webkit_javascript_result_unref (js_result); }

static void web_view_get_link_url (WebKitWebView *web_view, const gchar *link_id) { gchar *script;

script = g_strdup_printf ("window.document.getElementById('s').href;", link_id); webkit_web_view_run_javascript (web_view, script, NULL, web_view_javascript_finished, NULL); g_free (script); } </programlisting></informalexample>

runJavascriptFromGresource

webViewRunJavascriptFromGresource Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) 
=> a

webView: a WebView

-> Text

resource: the location of the resource to load

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the script finished

-> m () 

Asynchronously run the script from resource in the context of the current page in webView.

When the operation is finished, callback will be called. You can then call webViewRunJavascriptFromGresourceFinish to get the result of the operation.

runJavascriptFromGresourceFinish

webViewRunJavascriptFromGresourceFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m JavascriptResult

Returns: a JavascriptResult with the result of the last executed statement in script or Nothing in case of error (Can throw GError)

Finish an asynchronous operation started with webViewRunJavascriptFromGresource.

Check webViewRunJavascriptFinish for a usage example.

save

data WebViewSaveMethodInfo Source #

Instances

((~) * signature (SaveMode -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsWebView a, IsCancellable b) => MethodInfo * WebViewSaveMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy WebViewSaveMethodInfo a -> signature -> s #

webViewSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) 
=> a

webView: a WebView

-> SaveMode

saveMode: the SaveMode specifying how the web page should be saved.

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously save the current web page associated to the WebView into a self-contained format using the mode specified in saveMode.

When the operation is finished, callback will be called. You can then call webViewSaveFinish to get the result of the operation.

saveFinish

webViewSaveFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m InputStream

Returns: a InputStream with the result of saving the current web page or Nothing in case of error. (Can throw GError)

Finish an asynchronous operation started with webViewSave.

saveToFile

webViewSaveToFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsFile b, IsCancellable c) 
=> a

webView: a WebView

-> b

file: the File where the current web page should be saved to.

-> SaveMode

saveMode: the SaveMode specifying how the web page should be saved.

-> Maybe c

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously save the current web page associated to the WebView into a self-contained format using the mode specified in saveMode and writing it to file.

When the operation is finished, callback will be called. You can then call webViewSaveToFileFinish to get the result of the operation.

saveToFileFinish

webViewSaveToFileFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) 
=> a

webView: a WebView

-> b

result: a AsyncResult

-> m ()

(Can throw GError)

Finish an asynchronous operation started with webViewSaveToFile.

setBackgroundColor

webViewSetBackgroundColor Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> RGBA

rgba: a RGBA

-> m () 

Sets the color that will be used to draw the webView background before the actual contents are rendered. Note that if the web page loaded in webView specifies a background color, it will take precedence over the rgba color. By default the webView background color is opaque white. Note that the parent window must have a RGBA visual and Widget:app-paintable property set to True for backgrounds colors to work.

<informalexample><programlisting> static void browser_window_set_background_color (BrowserWindow *window, const GdkRGBA *rgba) { WebKitWebView *web_view; GdkScreen *screen = gtk_window_get_screen (GTK_WINDOW (window)); GdkVisual *rgba_visual = gdk_screen_get_rgba_visual (screen);

if (!rgba_visual) return;

gtk_widget_set_visual (GTK_WIDGET (window), rgba_visual); gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);

web_view = browser_window_get_web_view (window); webkit_web_view_set_background_color (web_view, rgba); } </programlisting></informalexample>

Since: 2.8

setCustomCharset

webViewSetCustomCharset Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Maybe Text

charset: a character encoding name or Nothing

-> m () 

Sets the current custom character encoding override of webView. The custom character encoding will override any text encoding detected via HTTP headers or META tags. Calling this method will stop any current load operation and reload the current page. Setting the custom character encoding to Nothing removes the character encoding override.

setEditable

data WebViewSetEditableMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewSetEditableMethodInfo a signature Source # 

webViewSetEditable Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Bool

editable: a Bool indicating the editable state

-> m () 

Sets whether the user is allowed to edit the HTML document.

If editable is True, webView allows the user to edit the HTML document. If editable is False, an element in webView's document can only be edited if the CONTENTEDITABLE attribute has been set on the element or one of its parent elements. By default a WebView is not editable.

Normally, a HTML document is not editable unless the elements within the document are editable. This function provides a way to make the contents of a WebView editable without altering the document or DOM structure.

Since: 2.8

setSettings

data WebViewSetSettingsMethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsWebView a, IsSettings b) => MethodInfo * WebViewSetSettingsMethodInfo a signature Source # 

webViewSetSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a, IsSettings b) 
=> a

webView: a WebView

-> b

settings: a Settings

-> m () 

Sets the Settings to be applied to webView. The existing Settings of webView will be replaced by settings. New settings are applied immediately on webView. The same Settings object can be shared by multiple WebView<!-- -->s.

setZoomLevel

webViewSetZoomLevel Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> Double

zoomLevel: the zoom level

-> m () 

Set the zoom level of webView, i.e. the factor by which the view contents are scaled with respect to their original size.

stopLoading

data WebViewStopLoadingMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewStopLoadingMethodInfo a signature Source # 

webViewStopLoading Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Stops any ongoing loading operation in webView. This method does nothing if no content is being loaded. If there is a loading operation in progress, it will be cancelled and WebView::load-failed signal will be emitted with NetworkErrorCancelled error.

tryClose

data WebViewTryCloseMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsWebView a) => MethodInfo * WebViewTryCloseMethodInfo a signature Source # 

webViewTryClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebView a) 
=> a

webView: a WebView

-> m () 

Tries to close the webView. This will fire the onbeforeunload event to ask the user for confirmation to close the page. If there isn't an onbeforeunload event handler or the user confirms to close the page, the WebView::close signal is emitted, otherwise nothing happens.

Since: 2.12

Properties

editable

data WebViewEditablePropertyInfo Source #

Instances

AttrInfo WebViewEditablePropertyInfo Source # 
type AttrOrigin WebViewEditablePropertyInfo Source # 
type AttrLabel WebViewEditablePropertyInfo Source # 
type AttrGetType WebViewEditablePropertyInfo Source # 
type AttrBaseTypeConstraint WebViewEditablePropertyInfo Source # 
type AttrSetTypeConstraint WebViewEditablePropertyInfo Source # 
type AttrAllowedOps WebViewEditablePropertyInfo Source # 

setWebViewEditable :: (MonadIO m, IsWebView o) => o -> Bool -> m () Source #

estimatedLoadProgress

data WebViewEstimatedLoadProgressPropertyInfo Source #

Instances

AttrInfo WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrOrigin WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrLabel WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrLabel WebViewEstimatedLoadProgressPropertyInfo = "estimated-load-progress"
type AttrGetType WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrSetTypeConstraint WebViewEstimatedLoadProgressPropertyInfo Source # 
type AttrAllowedOps WebViewEstimatedLoadProgressPropertyInfo Source # 

favicon

data WebViewFaviconPropertyInfo Source #

Instances

AttrInfo WebViewFaviconPropertyInfo Source # 
type AttrOrigin WebViewFaviconPropertyInfo Source # 
type AttrLabel WebViewFaviconPropertyInfo Source # 
type AttrGetType WebViewFaviconPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewFaviconPropertyInfo Source # 
type AttrSetTypeConstraint WebViewFaviconPropertyInfo Source # 
type AttrAllowedOps WebViewFaviconPropertyInfo Source # 

getWebViewFavicon :: (MonadIO m, IsWebView o) => o -> m (Ptr ()) Source #

isLoading

data WebViewIsLoadingPropertyInfo Source #

Instances

AttrInfo WebViewIsLoadingPropertyInfo Source # 
type AttrOrigin WebViewIsLoadingPropertyInfo Source # 
type AttrLabel WebViewIsLoadingPropertyInfo Source # 
type AttrGetType WebViewIsLoadingPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewIsLoadingPropertyInfo Source # 
type AttrSetTypeConstraint WebViewIsLoadingPropertyInfo Source # 
type AttrAllowedOps WebViewIsLoadingPropertyInfo Source # 

isPlayingAudio

data WebViewIsPlayingAudioPropertyInfo Source #

Instances

AttrInfo WebViewIsPlayingAudioPropertyInfo Source # 
type AttrOrigin WebViewIsPlayingAudioPropertyInfo Source # 
type AttrLabel WebViewIsPlayingAudioPropertyInfo Source # 
type AttrGetType WebViewIsPlayingAudioPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewIsPlayingAudioPropertyInfo Source # 
type AttrSetTypeConstraint WebViewIsPlayingAudioPropertyInfo Source # 
type AttrAllowedOps WebViewIsPlayingAudioPropertyInfo Source # 

relatedView

data WebViewRelatedViewPropertyInfo Source #

Instances

AttrInfo WebViewRelatedViewPropertyInfo Source # 
type AttrOrigin WebViewRelatedViewPropertyInfo Source # 
type AttrLabel WebViewRelatedViewPropertyInfo Source # 
type AttrGetType WebViewRelatedViewPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewRelatedViewPropertyInfo Source # 
type AttrSetTypeConstraint WebViewRelatedViewPropertyInfo Source # 
type AttrAllowedOps WebViewRelatedViewPropertyInfo Source # 

settings

data WebViewSettingsPropertyInfo Source #

Instances

AttrInfo WebViewSettingsPropertyInfo Source # 
type AttrOrigin WebViewSettingsPropertyInfo Source # 
type AttrLabel WebViewSettingsPropertyInfo Source # 
type AttrGetType WebViewSettingsPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewSettingsPropertyInfo Source # 
type AttrSetTypeConstraint WebViewSettingsPropertyInfo Source # 
type AttrAllowedOps WebViewSettingsPropertyInfo Source # 

setWebViewSettings :: (MonadIO m, IsWebView o, IsSettings a) => o -> a -> m () Source #

title

data WebViewTitlePropertyInfo Source #

Instances

AttrInfo WebViewTitlePropertyInfo Source # 
type AttrOrigin WebViewTitlePropertyInfo Source # 
type AttrLabel WebViewTitlePropertyInfo Source # 
type AttrGetType WebViewTitlePropertyInfo Source # 
type AttrBaseTypeConstraint WebViewTitlePropertyInfo Source # 
type AttrSetTypeConstraint WebViewTitlePropertyInfo Source # 
type AttrAllowedOps WebViewTitlePropertyInfo Source # 

uri

data WebViewUriPropertyInfo Source #

Instances

AttrInfo WebViewUriPropertyInfo Source # 
type AttrOrigin WebViewUriPropertyInfo Source # 
type AttrLabel WebViewUriPropertyInfo Source # 
type AttrGetType WebViewUriPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewUriPropertyInfo Source # 
type AttrSetTypeConstraint WebViewUriPropertyInfo Source # 
type AttrAllowedOps WebViewUriPropertyInfo Source # 

userContentManager

data WebViewUserContentManagerPropertyInfo Source #

Instances

AttrInfo WebViewUserContentManagerPropertyInfo Source # 
type AttrOrigin WebViewUserContentManagerPropertyInfo Source # 
type AttrLabel WebViewUserContentManagerPropertyInfo Source # 
type AttrLabel WebViewUserContentManagerPropertyInfo = "user-content-manager"
type AttrGetType WebViewUserContentManagerPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewUserContentManagerPropertyInfo Source # 
type AttrSetTypeConstraint WebViewUserContentManagerPropertyInfo Source # 
type AttrAllowedOps WebViewUserContentManagerPropertyInfo Source # 

webContext

data WebViewWebContextPropertyInfo Source #

Instances

AttrInfo WebViewWebContextPropertyInfo Source # 
type AttrOrigin WebViewWebContextPropertyInfo Source # 
type AttrLabel WebViewWebContextPropertyInfo Source # 
type AttrGetType WebViewWebContextPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewWebContextPropertyInfo Source # 
type AttrSetTypeConstraint WebViewWebContextPropertyInfo Source # 
type AttrAllowedOps WebViewWebContextPropertyInfo Source # 

zoomLevel

data WebViewZoomLevelPropertyInfo Source #

Instances

AttrInfo WebViewZoomLevelPropertyInfo Source # 
type AttrOrigin WebViewZoomLevelPropertyInfo Source # 
type AttrLabel WebViewZoomLevelPropertyInfo Source # 
type AttrGetType WebViewZoomLevelPropertyInfo Source # 
type AttrBaseTypeConstraint WebViewZoomLevelPropertyInfo Source # 
type AttrSetTypeConstraint WebViewZoomLevelPropertyInfo Source # 
type AttrAllowedOps WebViewZoomLevelPropertyInfo Source # 

Signals

authenticate

close

type C_WebViewCloseCallback = Ptr () -> Ptr () -> IO () Source #

contextMenu

contextMenuDismissed

create

decidePolicy

enterFullscreen

insecureContentDetected

leaveFullscreen

loadChanged

loadFailed

loadFailedWithTlsErrors

mouseTargetChanged

permissionRequest

print

readyToShow

resourceLoadStarted

runAsModal

runColorChooser

runFileChooser

scriptDialog

showNotification

submitForm

webProcessCrashed