gi-webkit2-4.0.23: WebKit2 bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.WebKit2.Objects.WebView

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype WebView Source #

Memory-managed wrapper type.

Constructors

WebView (ManagedPtr WebView) 
Instances
GObject WebView Source # 
Instance details

Defined in GI.WebKit2.Objects.WebView

Methods

gobjectType :: IO GType

HasParentTypes WebView Source # 
Instance details

Defined in GI.WebKit2.Objects.WebView

type ParentTypes WebView Source # 
Instance details

Defined in GI.WebKit2.Objects.WebView

type ParentTypes WebView = WebViewBase ': (Container ': (Widget ': (Object ': (ImplementorIface ': (Buildable ': ([] :: [Type]))))))

class (GObject o, IsDescendantOf WebView o) => IsWebView o Source #

Type class for types which can be safely cast to WebView, for instance with toWebView.

Instances
(GObject o, IsDescendantOf WebView o) => IsWebView o Source # 
Instance details

Defined in GI.WebKit2.Objects.WebView

toWebView :: (MonadIO m, IsWebView o) => o -> m WebView Source #

Cast to WebView, for types for which this is known to be safe. For general casts, use castTo.

noWebView :: Maybe WebView Source #

A convenience alias for Nothing :: Maybe WebView.

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 check if it is possible to 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 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 (Maybe 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 (Maybe 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

getMainResource

webViewGetMainResource Source #

Arguments

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

webView: a WebView

-> m (Maybe 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

webViewGetTitle Source #

Arguments

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

webView: a WebView

-> m (Maybe 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

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.

Since: 2.6

getWebsiteDataManager

webViewGetWebsiteDataManager Source #

Arguments

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

webView: a WebView

-> m WebsiteDataManager

Returns: a WebsiteDataManager

Get the WebsiteDataManager associated to webView. If webView is not ephemeral, the returned WebsiteDataManager will be the same as the WebsiteDataManager of webView's WebContext.

Since: 2.16

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

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

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.

isControlledByAutomation

webViewIsControlledByAutomation Source #

Arguments

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

webView: a WebView

-> m Bool

Returns: True if webView is controlled by automation, or False otherwise.

Get whether a WebView was created with WebView:is-controlled-by-automation property enabled. Only WebView<!-- -->s controlled by automation can be used in an automation session.

Since: 2.18

isEditable

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

No description available in the introspection data.

isEphemeral

webViewIsEphemeral Source #

Arguments

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

webView: a WebView

-> m Bool

Returns: True if webView is ephemeral or False otherwise.

Get whether a WebView is ephemeral. To create an ephemeral WebView you need to use g_object_new() and pass is-ephemeral property with True value. See WebView:is-ephemeral for more details. If webView was created with a ephemeral WebView:related-view or an ephemeral WebView:web-context it will also be ephemeral.

Since: 2.16

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 loading 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, then the back-forward list is maintained appropriately. For everything else this method works the same way as webViewLoadHtml.

loadBytes

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

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

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

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 WebView

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

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 WebKitSettings: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; JSCValue *value; 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; }

value = webkit_javascript_result_get_js_value (js_result); if (jsc_value_is_string (value)) { JSCException *exception; gchar *str_value;

str_value = jsc_value_to_string (value); exception = jsc_context_get_exception (jsc_value_get_context (value)); if (exception) g_warning ("Error running javascript: s", jsc_exception_get_message (exception)); else 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.

runJavascriptInWorld

webViewRunJavascriptInWorld Source #

Arguments

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

webView: a WebView

-> Text

script: the script to run

-> Text

worldName: the name of a WebKitScriptWorld

-> 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 script world with name worldName of the current page context in webView. If WebKitSettings:enable-javascript is FALSE, this method will do nothing.

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

Since: 2.22

runJavascriptInWorldFinish

webViewRunJavascriptInWorldFinish 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 webViewRunJavascriptInWorld.

Since: 2.22

save

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

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

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

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

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

Whether the pages loaded inside WebView are editable. For more information see webViewSetEditable.

Since: 2.8

constructWebViewEditable :: IsWebView o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “editable” property. This is rarely needed directly, but it is used by new.

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

Get the value of the “editable” property. When overloading is enabled, this is equivalent to

get webView #editable

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

Set the value of the “editable” property. When overloading is enabled, this is equivalent to

set webView [ #editable := value ]

estimatedLoadProgress

An estimate of the percent completion for the current loading operation. This value will range from 0.0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0.0. The value is an estimate based on the total number of bytes expected to be received for a document, including all its possible subresources and child documents.

getWebViewEstimatedLoadProgress :: (MonadIO m, IsWebView o) => o -> m Double Source #

Get the value of the “estimated-load-progress” property. When overloading is enabled, this is equivalent to

get webView #estimatedLoadProgress

favicon

The favicon currently associated to the WebView. See webViewGetFavicon for more details.

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

Get the value of the “favicon” property. When overloading is enabled, this is equivalent to

get webView #favicon

isControlledByAutomation

Whether the WebView is controlled by automation. This should only be used when creating a new WebView as a response to AutomationSession::create-web-view signal request.

Since: 2.18

constructWebViewIsControlledByAutomation :: IsWebView o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-controlled-by-automation” property. This is rarely needed directly, but it is used by new.

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

Get the value of the “is-controlled-by-automation” property. When overloading is enabled, this is equivalent to

get webView #isControlledByAutomation

isEphemeral

Whether the WebView is ephemeral. An ephemeral web view never writes website data to the client storage, no matter what WebsiteDataManager its context is using. This is normally used to implement private browsing mode. This is a ParamFlagsConstructOnly property, so you have to create a ephemeral WebView and it can't be changed. Note that all WebView<!-- -->s created with an ephemeral WebContext will be ephemeral automatically. See also webContextNewEphemeral.

Since: 2.16

constructWebViewIsEphemeral :: IsWebView o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-ephemeral” property. This is rarely needed directly, but it is used by new.

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

Get the value of the “is-ephemeral” property. When overloading is enabled, this is equivalent to

get webView #isEphemeral

isLoading

Whether the WebView is currently loading a page. This property becomes True as soon as a new load operation is requested and before the WebView::load-changed signal is emitted with LoadEventStarted and at that point the active URI is the requested one. When the load operation finishes the property is set to False before WebView::load-changed is emitted with LoadEventFinished.

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

Get the value of the “is-loading” property. When overloading is enabled, this is equivalent to

get webView #isLoading

isPlayingAudio

Whether the WebView is currently playing audio from a page. This property becomes True as soon as web content starts playing any kind of audio. When a page is no longer playing any kind of sound, the property is set back to False.

Since: 2.8

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

Get the value of the “is-playing-audio” property. When overloading is enabled, this is equivalent to

get webView #isPlayingAudio

relatedView

The related WebView used when creating the view to share the same web process. This property is not readable because the related web view is only valid during the object construction.

Since: 2.4

constructWebViewRelatedView :: (IsWebView o, IsWebView a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “related-view” property. This is rarely needed directly, but it is used by new.

settings

The Settings of the view.

Since: 2.6

constructWebViewSettings :: (IsWebView o, IsSettings a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “settings” property. This is rarely needed directly, but it is used by new.

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

Set the value of the “settings” property. When overloading is enabled, this is equivalent to

set webView [ #settings := value ]

title

The main frame document title of this WebView. If the title has not been received yet, it will be Nothing.

getWebViewTitle :: (MonadIO m, IsWebView o) => o -> m (Maybe Text) Source #

Get the value of the “title” property. When overloading is enabled, this is equivalent to

get webView #title

uri

The current active URI of the WebView. See webViewGetUri for more details.

getWebViewUri :: (MonadIO m, IsWebView o) => o -> m (Maybe Text) Source #

Get the value of the “uri” property. When overloading is enabled, this is equivalent to

get webView #uri

userContentManager

The UserContentManager of the view.

Since: 2.6

constructWebViewUserContentManager :: (IsWebView o, IsUserContentManager a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “user-content-manager” property. This is rarely needed directly, but it is used by new.

getWebViewUserContentManager :: (MonadIO m, IsWebView o) => o -> m UserContentManager Source #

Get the value of the “user-content-manager” property. When overloading is enabled, this is equivalent to

get webView #userContentManager

webContext

The WebContext of the view.

constructWebViewWebContext :: (IsWebView o, IsWebContext a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “web-context” property. This is rarely needed directly, but it is used by new.

getWebViewWebContext :: (MonadIO m, IsWebView o) => o -> m (Maybe WebContext) Source #

Get the value of the “web-context” property. When overloading is enabled, this is equivalent to

get webView #webContext

zoomLevel

The zoom level of the WebView content. See webViewSetZoomLevel for more details.

constructWebViewZoomLevel :: IsWebView o => Double -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “zoom-level” property. This is rarely needed directly, but it is used by new.

getWebViewZoomLevel :: (MonadIO m, IsWebView o) => o -> m Double Source #

Get the value of the “zoom-level” property. When overloading is enabled, this is equivalent to

get webView #zoomLevel

setWebViewZoomLevel :: (MonadIO m, IsWebView o) => o -> Double -> m () Source #

Set the value of the “zoom-level” property. When overloading is enabled, this is equivalent to

set webView [ #zoomLevel := value ]

Signals

authenticate

type C_WebViewAuthenticateCallback = Ptr () -> Ptr AuthenticationRequest -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewAuthenticateCallback Source #

Arguments

 = AuthenticationRequest

request: a AuthenticationRequest

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when the user is challenged with HTTP authentication. To let the application access or supply the credentials as well as to allow the client application to either cancel the request or perform the authentication, the signal will pass an instance of the AuthenticationRequest in the request argument. To handle this signal asynchronously you should keep a ref of the request and return True. To disable HTTP authentication entirely, connect to this signal and simply return True.

The default signal handler will run a default authentication dialog asynchronously for the user to interact with.

Since: 2.2

afterWebViewAuthenticate :: (IsWebView a, MonadIO m) => a -> WebViewAuthenticateCallback -> m SignalHandlerId Source #

Connect a signal handler for the “authenticate” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #authenticate callback

onWebViewAuthenticate :: (IsWebView a, MonadIO m) => a -> WebViewAuthenticateCallback -> m SignalHandlerId Source #

Connect a signal handler for the “authenticate” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #authenticate callback

close

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

Type for the callback on the (unwrapped) C side.

type WebViewCloseCallback = IO () Source #

Emitted when closing a WebView is requested. This occurs when a call is made from JavaScript's <function>window.close</function> function or after trying to close the webView with webViewTryClose. It is the owner's responsibility to handle this signal to hide or destroy the WebView, if necessary.

afterWebViewClose :: (IsWebView a, MonadIO m) => a -> WebViewCloseCallback -> m SignalHandlerId Source #

Connect a signal handler for the “close” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #close callback

genClosure_WebViewClose :: MonadIO m => WebViewCloseCallback -> m (GClosure C_WebViewCloseCallback) Source #

Wrap the callback into a GClosure.

mk_WebViewCloseCallback :: C_WebViewCloseCallback -> IO (FunPtr C_WebViewCloseCallback) Source #

Generate a function pointer callable from C code, from a C_WebViewCloseCallback.

onWebViewClose :: (IsWebView a, MonadIO m) => a -> WebViewCloseCallback -> m SignalHandlerId Source #

Connect a signal handler for the “close” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #close callback

contextMenu

type C_WebViewContextMenuCallback = Ptr () -> Ptr ContextMenu -> Ptr Event -> Ptr HitTestResult -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewContextMenuCallback Source #

Arguments

 = ContextMenu

contextMenu: the proposed ContextMenu

-> Event

event: the Event that triggered the context menu

-> HitTestResult

hitTestResult: a HitTestResult

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when a context menu is about to be displayed to give the application a chance to customize the proposed menu, prevent the menu from being displayed, or build its own context menu. <itemizedlist> <listitem><para> To customize the proposed menu you can use contextMenuPrepend, contextMenuAppend or contextMenuInsert to add new ContextMenuItem<!-- -->s to contextMenu, contextMenuMoveItem to reorder existing items, or contextMenuRemove to remove an existing item. The signal handler should return False, and the menu represented by contextMenu will be shown. </para></listitem> <listitem><para> To prevent the menu from being displayed you can just connect to this signal and return True so that the proposed menu will not be shown. </para></listitem> <listitem><para> To build your own menu, you can remove all items from the proposed menu with contextMenuRemoveAll, add your own items and return False so that the menu will be shown. You can also ignore the proposed ContextMenu, build your own Menu and return True to prevent the proposed menu from being shown. </para></listitem> <listitem><para> If you just want the default menu to be shown always, simply don't connect to this signal because showing the proposed context menu is the default behaviour. </para></listitem> </itemizedlist>

The event is expected to be one of the following types: <itemizedlist> <listitem><para> a EventButton of type EventTypeButtonPress when the context menu was triggered with mouse. </para></listitem> <listitem><para> a EventKey of type EventTypeKeyPress if the keyboard was used to show the menu. </para></listitem> <listitem><para> a generic Event of type EventTypeNothing when the Widget::popup-menu signal was used to show the context menu. </para></listitem> </itemizedlist>

If the signal handler returns False the context menu represented by contextMenu will be shown, if it return True the context menu will not be shown.

The proposed ContextMenu passed in contextMenu argument is only valid during the signal emission.

afterWebViewContextMenu :: (IsWebView a, MonadIO m) => a -> WebViewContextMenuCallback -> m SignalHandlerId Source #

Connect a signal handler for the “context-menu” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #contextMenu callback

onWebViewContextMenu :: (IsWebView a, MonadIO m) => a -> WebViewContextMenuCallback -> m SignalHandlerId Source #

Connect a signal handler for the “context-menu” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #contextMenu callback

contextMenuDismissed

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

Type for the callback on the (unwrapped) C side.

type WebViewContextMenuDismissedCallback = IO () Source #

Emitted after WebView::context-menu signal, if the context menu is shown, to notify that the context menu is dismissed.

afterWebViewContextMenuDismissed :: (IsWebView a, MonadIO m) => a -> WebViewContextMenuDismissedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “context-menu-dismissed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #contextMenuDismissed callback

onWebViewContextMenuDismissed :: (IsWebView a, MonadIO m) => a -> WebViewContextMenuDismissedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “context-menu-dismissed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #contextMenuDismissed callback

create

type C_WebViewCreateCallback = Ptr () -> Ptr NavigationAction -> Ptr () -> IO (Ptr Widget) Source #

Type for the callback on the (unwrapped) C side.

type WebViewCreateCallback Source #

Arguments

 = NavigationAction

navigationAction: a NavigationAction

-> IO Widget

Returns: a newly allocated WebView widget or Nothing to propagate the event further.

Emitted when the creation of a new WebView is requested. If this signal is handled the signal handler should return the newly created WebView.

The NavigationAction parameter contains information about the navigation action that triggered this signal.

When using ProcessModelMultipleSecondaryProcesses process model, the new WebView should be related to webView to share the same web process, see webViewNewWithRelatedView for more details.

The new WebView should not be displayed to the user until the WebView::ready-to-show signal is emitted.

afterWebViewCreate :: (IsWebView a, MonadIO m) => a -> WebViewCreateCallback -> m SignalHandlerId Source #

Connect a signal handler for the “create” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #create callback

genClosure_WebViewCreate :: MonadIO m => WebViewCreateCallback -> m (GClosure C_WebViewCreateCallback) Source #

Wrap the callback into a GClosure.

mk_WebViewCreateCallback :: C_WebViewCreateCallback -> IO (FunPtr C_WebViewCreateCallback) Source #

Generate a function pointer callable from C code, from a C_WebViewCreateCallback.

onWebViewCreate :: (IsWebView a, MonadIO m) => a -> WebViewCreateCallback -> m SignalHandlerId Source #

Connect a signal handler for the “create” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #create callback

decidePolicy

type C_WebViewDecidePolicyCallback = Ptr () -> Ptr PolicyDecision -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewDecidePolicyCallback Source #

Arguments

 = PolicyDecision

decision: the PolicyDecision

-> PolicyDecisionType

decisionType: a PolicyDecisionType denoting the type of decision

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when WebKit is requesting the client to decide a policy decision, such as whether to navigate to a page, open a new window or whether or not to download a resource. The NavigationPolicyDecision passed in the decision argument is a generic type, but should be casted to a more specific type when making the decision. For example:

<informalexample><programlisting> static gboolean decide_policy_cb (WebKitWebView *web_view, WebKitPolicyDecision *decision, WebKitPolicyDecisionType type) { switch (type) { case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: { WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision); /<!-- -->* Make a policy decision here. *<!-- -->/ break; } case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: { WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision); /<!-- -->* Make a policy decision here. *<!-- -->/ break; } case WEBKIT_POLICY_DECISION_TYPE_RESPONSE: WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision); /<!-- -->* Make a policy decision here. *<!-- -->/ break; default: /<!-- -->* Making no decision results in policyDecisionUse. *<!-- -->/ return FALSE; } return TRUE; } </programlisting></informalexample>

It is possible to make policy decision asynchronously, by simply calling objectRef on the decision argument and returning True to block the default signal handler. If the last reference is removed on a PolicyDecision and no decision has been made explicitly, policyDecisionUse will be the default policy decision. The default signal handler will simply call policyDecisionUse. Only the first policy decision chosen for a given PolicyDecision will have any affect.

afterWebViewDecidePolicy :: (IsWebView a, MonadIO m) => a -> WebViewDecidePolicyCallback -> m SignalHandlerId Source #

Connect a signal handler for the “decide-policy” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #decidePolicy callback

onWebViewDecidePolicy :: (IsWebView a, MonadIO m) => a -> WebViewDecidePolicyCallback -> m SignalHandlerId Source #

Connect a signal handler for the “decide-policy” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #decidePolicy callback

enterFullscreen

type C_WebViewEnterFullscreenCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewEnterFullscreenCallback Source #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to continue emission of the event.

Emitted when JavaScript code calls <function>element.webkitRequestFullScreen</function>. If the signal is not handled the WebView will proceed to full screen its top level window. This signal can be used by client code to request permission to the user prior doing the full screen transition and eventually prepare the top-level window (e.g. hide some widgets that would otherwise be part of the full screen window).

afterWebViewEnterFullscreen :: (IsWebView a, MonadIO m) => a -> WebViewEnterFullscreenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “enter-fullscreen” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #enterFullscreen callback

onWebViewEnterFullscreen :: (IsWebView a, MonadIO m) => a -> WebViewEnterFullscreenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “enter-fullscreen” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #enterFullscreen callback

insecureContentDetected

type C_WebViewInsecureContentDetectedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewInsecureContentDetectedCallback Source #

Arguments

 = InsecureContentEvent

event: the InsecureContentEvent

-> IO () 

This signal is emitted when insecure content has been detected in a page loaded through a secure connection. This typically means that a external resource from an unstrusted source has been run or displayed, resulting in a mix of HTTPS and non-HTTPS content.

You can check the event parameter to know exactly which kind of event has been detected (see InsecureContentEvent).

afterWebViewInsecureContentDetected :: (IsWebView a, MonadIO m) => a -> WebViewInsecureContentDetectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “insecure-content-detected” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #insecureContentDetected callback

onWebViewInsecureContentDetected :: (IsWebView a, MonadIO m) => a -> WebViewInsecureContentDetectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “insecure-content-detected” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #insecureContentDetected callback

leaveFullscreen

type C_WebViewLeaveFullscreenCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewLeaveFullscreenCallback Source #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to continue emission of the event.

Emitted when the WebView is about to restore its top level window out of its full screen state. This signal can be used by client code to restore widgets hidden during the WebView::enter-fullscreen stage for instance.

afterWebViewLeaveFullscreen :: (IsWebView a, MonadIO m) => a -> WebViewLeaveFullscreenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “leave-fullscreen” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #leaveFullscreen callback

onWebViewLeaveFullscreen :: (IsWebView a, MonadIO m) => a -> WebViewLeaveFullscreenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “leave-fullscreen” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #leaveFullscreen callback

loadChanged

type C_WebViewLoadChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewLoadChangedCallback Source #

Arguments

 = LoadEvent

loadEvent: the LoadEvent

-> IO () 

Emitted when a load operation in webView changes. The signal is always emitted with LoadEventStarted when a new load request is made and LoadEventFinished when the load finishes successfully or due to an error. When the ongoing load operation fails WebView::load-failed signal is emitted before WebView::load-changed is emitted with LoadEventFinished. If a redirection is received from the server, this signal is emitted with LoadEventRedirected after the initial emission with LoadEventStarted and before LoadEventCommitted. When the page content starts arriving the signal is emitted with LoadEventCommitted event.

You can handle this signal and use a switch to track any ongoing load operation.

<informalexample><programlisting> static void web_view_load_changed (WebKitWebView *web_view, WebKitLoadEvent load_event, gpointer user_data) { switch (load_event) { case WEBKIT_LOAD_STARTED: /<!-- -->* New load, we have now a provisional URI *<!-- -->/ provisional_uri = webkit_web_view_get_uri (web_view); /<!-- -->* Here we could start a spinner or update the <!-- -->* location bar with the provisional URI *<!-- -->/ break; case WEBKIT_LOAD_REDIRECTED: redirected_uri = webkit_web_view_get_uri (web_view); break; case WEBKIT_LOAD_COMMITTED: /<!-- -->* The load is being performed. Current URI is <!-- -->* the final one and it won't change unless a new <!-- -->* load is requested or a navigation within the <!-- -->* same page is performed *<!-- -->/ uri = webkit_web_view_get_uri (web_view); break; case WEBKIT_LOAD_FINISHED: /<!-- -->* Load finished, we can now stop the spinner *<!-- -->/ break; } } </programlisting></informalexample>

afterWebViewLoadChanged :: (IsWebView a, MonadIO m) => a -> WebViewLoadChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-changed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #loadChanged callback

onWebViewLoadChanged :: (IsWebView a, MonadIO m) => a -> WebViewLoadChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #loadChanged callback

loadFailed

type C_WebViewLoadFailedCallback = Ptr () -> CUInt -> CString -> Ptr GError -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewLoadFailedCallback Source #

Arguments

 = LoadEvent

loadEvent: the LoadEvent of the load operation

-> Text

failingUri: the URI that failed to load

-> GError

error: the GError that was triggered

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when an error occurs during a load operation. If the error happened when starting to load data for a page loadEvent will be LoadEventStarted. If it happened while loading a committed data source loadEvent will be LoadEventCommitted. Since a load error causes the load operation to finish, the signal WebKitWebView::load-changed will always be emitted with LoadEventFinished event right after this one.

By default, if the signal is not handled, a stock error page will be displayed. You need to handle the signal if you want to provide your own error page.

afterWebViewLoadFailed :: (IsWebView a, MonadIO m) => a -> WebViewLoadFailedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-failed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #loadFailed callback

genClosure_WebViewLoadFailed :: MonadIO m => WebViewLoadFailedCallback -> m (GClosure C_WebViewLoadFailedCallback) Source #

Wrap the callback into a GClosure.

onWebViewLoadFailed :: (IsWebView a, MonadIO m) => a -> WebViewLoadFailedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-failed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #loadFailed callback

loadFailedWithTlsErrors

type C_WebViewLoadFailedWithTlsErrorsCallback = Ptr () -> CString -> Ptr TlsCertificate -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewLoadFailedWithTlsErrorsCallback Source #

Arguments

 = Text

failingUri: the URI that failed to load

-> TlsCertificate

certificate: a TlsCertificate

-> [TlsCertificateFlags]

errors: a TlsCertificateFlags with the verification status of certificate

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when a TLS error occurs during a load operation. To allow an exception for this certificate and the host of failingUri use webContextAllowTlsCertificateForHost.

To handle this signal asynchronously you should call objectRef on certificate and return True.

If False is returned, WebView::load-failed will be emitted. The load will finish regardless of the returned value.

Since: 2.6

afterWebViewLoadFailedWithTlsErrors :: (IsWebView a, MonadIO m) => a -> WebViewLoadFailedWithTlsErrorsCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-failed-with-tls-errors” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #loadFailedWithTlsErrors callback

onWebViewLoadFailedWithTlsErrors :: (IsWebView a, MonadIO m) => a -> WebViewLoadFailedWithTlsErrorsCallback -> m SignalHandlerId Source #

Connect a signal handler for the “load-failed-with-tls-errors” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #loadFailedWithTlsErrors callback

mouseTargetChanged

type C_WebViewMouseTargetChangedCallback = Ptr () -> Ptr HitTestResult -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewMouseTargetChangedCallback Source #

Arguments

 = HitTestResult

hitTestResult: a HitTestResult

-> Word32

modifiers: a bitmask of ModifierType

-> IO () 

This signal is emitted when the mouse cursor moves over an element such as a link, image or a media element. To determine what type of element the mouse cursor is over, a Hit Test is performed on the current mouse coordinates and the result is passed in the hitTestResult argument. The modifiers argument is a bitmask of ModifierType flags indicating the state of modifier keys. The signal is emitted again when the mouse is moved out of the current element with a new hitTestResult.

afterWebViewMouseTargetChanged :: (IsWebView a, MonadIO m) => a -> WebViewMouseTargetChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “mouse-target-changed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #mouseTargetChanged callback

onWebViewMouseTargetChanged :: (IsWebView a, MonadIO m) => a -> WebViewMouseTargetChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “mouse-target-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #mouseTargetChanged callback

permissionRequest

type C_WebViewPermissionRequestCallback = Ptr () -> Ptr PermissionRequest -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewPermissionRequestCallback Source #

Arguments

 = PermissionRequest

request: the PermissionRequest

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when WebKit is requesting the client to decide about a permission request, such as allowing the browser to switch to fullscreen mode, sharing its location or similar operations.

A possible way to use this signal could be through a dialog allowing the user decide what to do with the request:

<informalexample><programlisting> static gboolean permission_request_cb (WebKitWebView *web_view, WebKitPermissionRequest *request, GtkWindow *parent_window) { GtkWidget *dialog = gtk_message_dialog_new (parent_window, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "Allow Permission Request?"); gtk_widget_show (dialog); gint result = gtk_dialog_run (GTK_DIALOG (dialog));

switch (result) { case GTK_RESPONSE_YES: webkit_permission_request_allow (request); break; default: webkit_permission_request_deny (request); break; } gtk_widget_destroy (dialog);

return TRUE; } </programlisting></informalexample>

It is possible to handle permission requests asynchronously, by simply calling objectRef on the request argument and returning True to block the default signal handler. If the last reference is removed on a PermissionRequest and the request has not been handled, permissionRequestDeny will be the default action.

If the signal is not handled, the request will be completed automatically by the specific PermissionRequest that could allow or deny it. Check the documentation of classes implementing PermissionRequest interface to know their default action.

afterWebViewPermissionRequest :: (IsWebView a, MonadIO m) => a -> WebViewPermissionRequestCallback -> m SignalHandlerId Source #

Connect a signal handler for the “permission-request” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #permissionRequest callback

onWebViewPermissionRequest :: (IsWebView a, MonadIO m) => a -> WebViewPermissionRequestCallback -> m SignalHandlerId Source #

Connect a signal handler for the “permission-request” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #permissionRequest callback

print

type C_WebViewPrintCallback = Ptr () -> Ptr PrintOperation -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewPrintCallback Source #

Arguments

 = PrintOperation

printOperation: the PrintOperation that will handle the print request

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when printing is requested on webView, usually by a JavaScript call, before the print dialog is shown. This signal can be used to set the initial print settings and page setup of printOperation to be used as default values in the print dialog. You can call printOperationSetPrintSettings and printOperationSetPageSetup and then return False to propagate the event so that the print dialog is shown.

You can connect to this signal and return True to cancel the print operation or implement your own print dialog.

afterWebViewPrint :: (IsWebView a, MonadIO m) => a -> WebViewPrintCallback -> m SignalHandlerId Source #

Connect a signal handler for the “print” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #print callback

genClosure_WebViewPrint :: MonadIO m => WebViewPrintCallback -> m (GClosure C_WebViewPrintCallback) Source #

Wrap the callback into a GClosure.

mk_WebViewPrintCallback :: C_WebViewPrintCallback -> IO (FunPtr C_WebViewPrintCallback) Source #

Generate a function pointer callable from C code, from a C_WebViewPrintCallback.

onWebViewPrint :: (IsWebView a, MonadIO m) => a -> WebViewPrintCallback -> m SignalHandlerId Source #

Connect a signal handler for the “print” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #print callback

readyToShow

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

Type for the callback on the (unwrapped) C side.

type WebViewReadyToShowCallback = IO () Source #

Emitted after WebView::create on the newly created WebView when it should be displayed to the user. When this signal is emitted all the information about how the window should look, including size, position, whether the location, status and scrollbars should be displayed, is already set on the WindowProperties of webView. See also webViewGetWindowProperties.

afterWebViewReadyToShow :: (IsWebView a, MonadIO m) => a -> WebViewReadyToShowCallback -> m SignalHandlerId Source #

Connect a signal handler for the “ready-to-show” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #readyToShow callback

onWebViewReadyToShow :: (IsWebView a, MonadIO m) => a -> WebViewReadyToShowCallback -> m SignalHandlerId Source #

Connect a signal handler for the “ready-to-show” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #readyToShow callback

resourceLoadStarted

type C_WebViewResourceLoadStartedCallback = Ptr () -> Ptr WebResource -> Ptr URIRequest -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewResourceLoadStartedCallback Source #

Arguments

 = WebResource

resource: a WebResource

-> URIRequest

request: a URIRequest

-> IO () 

Emitted when a new resource is going to be loaded. The request parameter contains the URIRequest that will be sent to the server. You can monitor the load operation by connecting to the different signals of resource.

afterWebViewResourceLoadStarted :: (IsWebView a, MonadIO m) => a -> WebViewResourceLoadStartedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “resource-load-started” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #resourceLoadStarted callback

onWebViewResourceLoadStarted :: (IsWebView a, MonadIO m) => a -> WebViewResourceLoadStartedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “resource-load-started” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #resourceLoadStarted callback

runAsModal

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

Type for the callback on the (unwrapped) C side.

type WebViewRunAsModalCallback = IO () Source #

Emitted after WebView::ready-to-show on the newly created WebView when JavaScript code calls <function>window.showModalDialog</function>. The purpose of this signal is to allow the client application to prepare the new view to behave as modal. Once the signal is emitted a new main loop will be run to block user interaction in the parent WebView until the new dialog is closed.

afterWebViewRunAsModal :: (IsWebView a, MonadIO m) => a -> WebViewRunAsModalCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-as-modal” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #runAsModal callback

genClosure_WebViewRunAsModal :: MonadIO m => WebViewRunAsModalCallback -> m (GClosure C_WebViewRunAsModalCallback) Source #

Wrap the callback into a GClosure.

onWebViewRunAsModal :: (IsWebView a, MonadIO m) => a -> WebViewRunAsModalCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-as-modal” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #runAsModal callback

runColorChooser

type C_WebViewRunColorChooserCallback = Ptr () -> Ptr ColorChooserRequest -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewRunColorChooserCallback Source #

Arguments

 = ColorChooserRequest

request: a ColorChooserRequest

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when the user interacts with a &lt;input type='color' /&gt; HTML element, requesting from WebKit to show a dialog to select a color. To let the application know the details of the color chooser, as well as to allow the client application to either cancel the request or perform an actual color selection, the signal will pass an instance of the ColorChooserRequest in the request argument.

It is possible to handle this request asynchronously by increasing the reference count of the request.

The default signal handler will asynchronously run a regular ColorChooser for the user to interact with.

Since: 2.8

afterWebViewRunColorChooser :: (IsWebView a, MonadIO m) => a -> WebViewRunColorChooserCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-color-chooser” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #runColorChooser callback

onWebViewRunColorChooser :: (IsWebView a, MonadIO m) => a -> WebViewRunColorChooserCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-color-chooser” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #runColorChooser callback

runFileChooser

type C_WebViewRunFileChooserCallback = Ptr () -> Ptr FileChooserRequest -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewRunFileChooserCallback Source #

Arguments

 = FileChooserRequest

request: a FileChooserRequest

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when the user interacts with a &lt;input type='file' /&gt; HTML element, requesting from WebKit to show a dialog to select one or more files to be uploaded. To let the application know the details of the file chooser, as well as to allow the client application to either cancel the request or perform an actual selection of files, the signal will pass an instance of the FileChooserRequest in the request argument.

The default signal handler will asynchronously run a regular FileChooserDialog for the user to interact with.

afterWebViewRunFileChooser :: (IsWebView a, MonadIO m) => a -> WebViewRunFileChooserCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-file-chooser” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #runFileChooser callback

onWebViewRunFileChooser :: (IsWebView a, MonadIO m) => a -> WebViewRunFileChooserCallback -> m SignalHandlerId Source #

Connect a signal handler for the “run-file-chooser” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #runFileChooser callback

scriptDialog

type C_WebViewScriptDialogCallback = Ptr () -> Ptr ScriptDialog -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewScriptDialogCallback Source #

Arguments

 = ScriptDialog

dialog: the ScriptDialog to show

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when JavaScript code calls <function>window.alert</function>, <function>window.confirm</function> or <function>window.prompt</function>, or when <function>onbeforeunload</function> event is fired. The dialog parameter should be used to build the dialog. If the signal is not handled a different dialog will be built and shown depending on the dialog type: <itemizedlist> <listitem><para> ScriptDialogTypeAlert: message dialog with a single Close button. </para></listitem> <listitem><para> ScriptDialogTypeConfirm: message dialog with OK and Cancel buttons. </para></listitem> <listitem><para> ScriptDialogTypePrompt: message dialog with OK and Cancel buttons and a text entry with the default text. </para></listitem> <listitem><para> ScriptDialogTypeBeforeUnloadConfirm: message dialog with Stay and Leave buttons. </para></listitem> </itemizedlist>

It is possible to handle the script dialog request asynchronously, by simply caling scriptDialogRef on the dialog argument and calling scriptDialogClose when done. If the last reference is removed on a ScriptDialog and the dialog has not been closed, scriptDialogClose will be called.

afterWebViewScriptDialog :: (IsWebView a, MonadIO m) => a -> WebViewScriptDialogCallback -> m SignalHandlerId Source #

Connect a signal handler for the “script-dialog” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #scriptDialog callback

onWebViewScriptDialog :: (IsWebView a, MonadIO m) => a -> WebViewScriptDialogCallback -> m SignalHandlerId Source #

Connect a signal handler for the “script-dialog” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #scriptDialog callback

showNotification

type C_WebViewShowNotificationCallback = Ptr () -> Ptr Notification -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewShowNotificationCallback Source #

Arguments

 = Notification

notification: a Notification

-> IO Bool

Returns: True to stop other handlers from being invoked. False otherwise.

This signal is emitted when a notification should be presented to the user. The notification is kept alive until either: 1) the web page cancels it or 2) a navigation happens.

The default handler will emit a notification using libnotify, if built with support for it.

Since: 2.8

afterWebViewShowNotification :: (IsWebView a, MonadIO m) => a -> WebViewShowNotificationCallback -> m SignalHandlerId Source #

Connect a signal handler for the “show-notification” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #showNotification callback

onWebViewShowNotification :: (IsWebView a, MonadIO m) => a -> WebViewShowNotificationCallback -> m SignalHandlerId Source #

Connect a signal handler for the “show-notification” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #showNotification callback

showOptionMenu

type C_WebViewShowOptionMenuCallback = Ptr () -> Ptr OptionMenu -> Ptr Event -> Ptr Rectangle -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewShowOptionMenuCallback Source #

Arguments

 = OptionMenu

menu: the OptionMenu

-> Event

event: the Event that triggered the menu, or Nothing

-> Rectangle

rectangle: the option element area

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when a select element in webView needs to display a dropdown menu. This signal can be used to show a custom menu, using menu to get the details of all items that should be displayed. The area of the element in the WebView is given as rectangle parameter, it can be used to position the menu. If this was triggered by a user interaction, like a mouse click, event parameter provides the Event. To handle this signal asynchronously you should keep a ref of the menu.

The default signal handler will pop up a Menu.

Since: 2.18

afterWebViewShowOptionMenu :: (IsWebView a, MonadIO m) => a -> WebViewShowOptionMenuCallback -> m SignalHandlerId Source #

Connect a signal handler for the “show-option-menu” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #showOptionMenu callback

onWebViewShowOptionMenu :: (IsWebView a, MonadIO m) => a -> WebViewShowOptionMenuCallback -> m SignalHandlerId Source #

Connect a signal handler for the “show-option-menu” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #showOptionMenu callback

submitForm

type C_WebViewSubmitFormCallback = Ptr () -> Ptr FormSubmissionRequest -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewSubmitFormCallback Source #

Arguments

 = FormSubmissionRequest

request: a FormSubmissionRequest

-> IO () 

This signal is emitted when a form is about to be submitted. The request argument passed contains information about the text fields of the form. This is typically used to store login information that can be used later to pre-fill the form. The form will not be submitted until formSubmissionRequestSubmit is called.

It is possible to handle the form submission request asynchronously, by simply calling objectRef on the request argument and calling formSubmissionRequestSubmit when done to continue with the form submission. If the last reference is removed on a FormSubmissionRequest and the form has not been submitted, formSubmissionRequestSubmit will be called.

afterWebViewSubmitForm :: (IsWebView a, MonadIO m) => a -> WebViewSubmitFormCallback -> m SignalHandlerId Source #

Connect a signal handler for the “submit-form” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #submitForm callback

genClosure_WebViewSubmitForm :: MonadIO m => WebViewSubmitFormCallback -> m (GClosure C_WebViewSubmitFormCallback) Source #

Wrap the callback into a GClosure.

onWebViewSubmitForm :: (IsWebView a, MonadIO m) => a -> WebViewSubmitFormCallback -> m SignalHandlerId Source #

Connect a signal handler for the “submit-form” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #submitForm callback

webProcessCrashed

type C_WebViewWebProcessCrashedCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WebViewWebProcessCrashedCallback Source #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Deprecated: (Since version 2.20)Use WebKitWebView::web-process-terminated instead.

This signal is emitted when the web process crashes.

afterWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> WebViewWebProcessCrashedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “web-process-crashed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #webProcessCrashed callback

onWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> WebViewWebProcessCrashedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “web-process-crashed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #webProcessCrashed callback

webProcessTerminated

type C_WebViewWebProcessTerminatedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WebViewWebProcessTerminatedCallback Source #

This signal is emitted when the web process terminates abnormally due to reason.

Since: 2.20

afterWebViewWebProcessTerminated :: (IsWebView a, MonadIO m) => a -> WebViewWebProcessTerminatedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “web-process-terminated” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after webView #webProcessTerminated callback

onWebViewWebProcessTerminated :: (IsWebView a, MonadIO m) => a -> WebViewWebProcessTerminatedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “web-process-terminated” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on webView #webProcessTerminated callback