gi-webkit-6.0.2: WebKit bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit.Objects.WebView

Contents

Description

The central class of the WPE WebKit and WebKitGTK APIs.

WebView is the central class of the WPE WebKit and WebKitGTK APIs. It is responsible for managing the drawing of the content and forwarding of events. You can load any URI into the WebView or a data string. With Settings you can control various aspects of the rendering and loading of the content.

Note that in WebKitGTK, WebView is scrollable by itself, so you don't need to embed it in a ScrolledWindow.

Synopsis

Exported types

newtype WebView Source #

Memory-managed wrapper type.

Constructors

WebView (ManagedPtr WebView) 

Instances

Instances details
Eq WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

Methods

(==) :: WebView -> WebView -> Bool #

(/=) :: WebView -> WebView -> Bool #

GObject WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

ManagedPtrNewtype WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

Methods

toManagedPtr :: WebView -> ManagedPtr WebView

TypedObject WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

Methods

glibType :: IO GType

HasParentTypes WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

IsGValue (Maybe WebView) Source #

Convert WebView to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit.Objects.WebView

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe WebView -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe WebView)

type ParentTypes WebView Source # 
Instance details

Defined in GI.WebKit.Objects.WebView

type ParentTypes WebView = '[WebViewBase, Widget, Object, Accessible, Buildable, ConstraintTarget]

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

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

Defined in GI.WebKit.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.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, callAsyncJavascriptFunction, callAsyncJavascriptFunctionFinish, canExecuteEditingCommand, canExecuteEditingCommandFinish, canGoBack, canGoForward, canShowMimeType, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, downloadUri, dragCheckThreshold, errorBell, evaluateJavascript, evaluateJavascriptFinish, executeEditingCommand, executeEditingCommandWithArgument, forceFloating, freezeNotify, getv, goBack, goForward, goToBackForwardListItem, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isControlledByAutomation, isDrawable, isEditable, isFloating, isFocus, isLoading, isPlayingAudio, isSensitive, isVisible, keynavFailed, listMnemonicLabels, loadAlternateHtml, loadBytes, loadHtml, loadPlainText, loadRequest, loadUri, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, reload, reloadBypassCache, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, restoreSessionState, runDispose, save, saveFinish, saveToFile, saveToFileFinish, sendMessageToPage, sendMessageToPageFinish, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, stopLoading, terminateWebProcess, thawNotify, translateCoordinates, triggerTooltipQuery, tryClose, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getAutomationPresentationType, getBackForwardList, getBackgroundColor, getBounds, getBuildableId, getCameraCaptureState, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getContext, getCssClasses, getCssName, getCursor, getCustomCharset, getData, getDefaultContentSecurityPolicy, getDirection, getDisplay, getDisplayCaptureState, getEditorState, getEstimatedLoadProgress, getFavicon, getFindController, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getInputMethodContext, getInspector, getIsMuted, getIsWebProcessResponsive, getLastChild, getLayoutManager, getMainResource, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMicrophoneCaptureState, getName, getNative, getNetworkSession, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPageId, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSessionState, getSettings, getSize, getSizeRequest, getSnapshot, getSnapshotFinish, getStateFlags, getStyleContext, getTemplateChild, getTitle, getTlsInfo, getTooltipMarkup, getTooltipText, getUri, getUserContentManager, getValign, getVexpand, getVexpandSet, getVisible, getWebExtensionMode, getWebsitePolicies, getWidth, getWindowProperties, getZoomLevel.

Setters

setAccessibleParent, setBackgroundColor, setCameraCaptureState, setCanFocus, setCanTarget, setChildVisible, setCorsAllowlist, setCssClasses, setCursor, setCursorFromName, setCustomCharset, setData, setDataFull, setDirection, setDisplayCaptureState, setEditable, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setInputMethodContext, setIsMuted, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMicrophoneCaptureState, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSettings, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setZoomLevel.

callAsyncJavascriptFunction

webViewCallAsyncJavascriptFunction Source #

Arguments

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

webView: a WebView

-> Text

body: the function body

-> Int64

length: length of body, or -1 if body is a nul-terminated string

-> Maybe GVariant

arguments: a GVariant with format a{sv} storing the function arguments, or Nothing

-> Maybe Text

worldName: the name of a WebKitScriptWorld or Nothing to use the default

-> Maybe Text

sourceUri: the source URI

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the script finished

-> m () 

Asynchronously call body with arguments in the script world with name worldName of the main frame current context in webView. The arguments values must be one of the following types, or contain only the following GVariant types: number, string and dictionary. The result of the operation can be a Promise that will be properly passed to the callback. If worldName is Nothing, the default world is used. Any value that is not Nothing is a distin ct world. The sourceUri will be shown in exceptions and doesn't affect the behavior of the script. When not provided, the document URL is used.

Note that if Settings:enableJavascript is False, this method will do nothing. If you want to use this method but still prevent web content from executing its own JavaScript, then use Settings:enableJavascriptMarkup.

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

This is an example that shows how to pass arguments to a JS function that returns a Promise that resolves with the passed argument:

c code

static void
web_view_javascript_finished (GObject      *object,
                              GAsyncResult *result,
                              gpointer      user_data)
{
    JSCValue               *value;
    GError                 *error = NULL;

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

    if (jsc_value_is_number (value)) {
        gint32        int_value = jsc_value_to_string (value);
        JSCException *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: %d\n", int_value);
        g_free (str_value);
    } else {
        g_warning ("Error running javascript: unexpected return value");
    }
    webkit_javascript_result_unref (js_result);
}

static void
web_view_evaluate_promise (WebKitWebView *web_view)
{
    GVariantDict dict;
    g_variant_dict_init (&dict, NULL);
    g_variant_dict_insert (&dict, "count", "u", 42);
    GVariant *args = g_variant_dict_end (&dict);
    const gchar *body = "return new Promise((resolve) => { resolve(count); });";
    webkit_web_view_call_async_javascript_function (web_view, body, -1, arguments, NULL, NULL, NULL, web_view_javascript_finished, NULL);
}

Since: 2.40

callAsyncJavascriptFunctionFinish

webViewCallAsyncJavascriptFunctionFinish Source #

Arguments

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

webView: a WebView

-> b

result: a AsyncResult

-> m Value

Returns: a Value with the return value of the async function or Nothing in case of error (Can throw GError)

Finish an asynchronous operation started with webViewCallAsyncJavascriptFunction.

Since: 2.40

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.

evaluateJavascript

webViewEvaluateJavascript Source #

Arguments

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

webView: a WebView

-> Text

script: the script to evaluate

-> Int64

length: length of script, or -1 if script is a nul-terminated string

-> Maybe Text

worldName: the name of a WebKitScriptWorld or Nothing to use the default

-> Maybe Text

sourceUri: the source URI

-> Maybe b

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the script finished

-> m () 

Asynchronously evaluate script in the script world with name worldName of the main frame current context in webView. If worldName is Nothing, the default world is used. Any value that is not Nothing is a distinct world. The sourceUri will be shown in exceptions and doesn't affect the behavior of the script. When not provided, the document URL is used.

Note that if Settings:enableJavascript is False, this method will do nothing. If you want to use this method but still prevent web content from executing its own JavaScript, then use Settings:enableJavascriptMarkup.

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

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

c code

static void
web_view_javascript_finished (GObject      *object,
                              GAsyncResult *result,
                              gpointer      user_data)
{
    JSCValue               *value;
    GError                 *error = NULL;

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

    if (jsc_value_is_string (value)) {
        gchar        *str_value = jsc_value_to_string (value);
        JSCException *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 = g_strdup_printf ("window.document.getElementById('%s').href;", link_id);
    webkit_web_view_evaluate_javascript (web_view, script, -1, NULL, NULL, NULL, web_view_javascript_finished, NULL);
    g_free (script);
}

Since: 2.40

evaluateJavascriptFinish

webViewEvaluateJavascriptFinish Source #

Arguments

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

webView: a WebView

-> b

result: a AsyncResult

-> m Value

Returns: a Value 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 webViewEvaluateJavascript.

Since: 2.40

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

getAutomationPresentationType

webViewGetAutomationPresentationType Source #

Get the presentation type of WebView when created for automation.

Since: 2.28

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.

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

getCameraCaptureState

webViewGetCameraCaptureState Source #

Arguments

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

webView: a WebView

-> m MediaCaptureState

Returns: The MediaCaptureState of the camera device. If Settings:enable-mediastream is False, this method will return MediaCaptureStateNone.

Get the camera capture state of a WebView.

Since: 2.34

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.

getDefaultContentSecurityPolicy

webViewGetDefaultContentSecurityPolicy Source #

Arguments

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

webView: a WebView

-> m (Maybe Text)

Returns: The default policy or Nothing

Gets the configured default Content-Security-Policy.

Since: 2.38

getDisplayCaptureState

webViewGetDisplayCaptureState Source #

Arguments

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

webView: a WebView

-> m MediaCaptureState

Returns: The MediaCaptureState of the display device. If Settings:enable-mediastream is False, this method will return MediaCaptureStateNone.

Get the display capture state of a WebView.

Since: 2.34

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:estimatedLoadProgress property.

You can monitor the estimated progress of a load operation by connecting to the notifyestimatedLoadProgress signal of webView.

getFavicon

webViewGetFavicon Source #

Arguments

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

webView: a WebView

-> m Texture

Returns: the favicon image or Nothing if there's no icon associated with webView.

Returns favicon currently associated to webView.

Returns favicon currently associated to webView, if any. You can connect to notifyfavicon 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.

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

getInputMethodContext

webViewGetInputMethodContext Source #

Arguments

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

webView: a WebView

-> m (Maybe InputMethodContext)

Returns: a InputMethodContext, or Nothing

Get the InputMethodContext currently in use by webView.

Get the InputMethodContext currently in use by webView, or Nothing if no input method is being used.

Since: 2.28

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

getIsMuted

webViewGetIsMuted Source #

Arguments

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

webView: a WebView

-> m Bool

Returns: True if webView audio is muted or False is audio is not muted.

Gets the mute state of webView.

Since: 2.30

getIsWebProcessResponsive

webViewGetIsWebProcessResponsive Source #

Arguments

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

webView: a WebView

-> m Bool

Returns: True if the web process attached to webView is responsive, or False otherwise.

Get whether the current web process of a WebView is responsive.

Since: 2.34

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.

getMicrophoneCaptureState

webViewGetMicrophoneCaptureState Source #

Arguments

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

webView: a WebView

-> m MediaCaptureState

Returns: The MediaCaptureState of the microphone device. If Settings:enable-mediastream is False, this method will return MediaCaptureStateNone.

Get the microphone capture state of a WebView.

Since: 2.34

getNetworkSession

webViewGetNetworkSession Source #

Arguments

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

webView: a WebView

-> m NetworkSession

Returns: a NetworkSession

Get the NetworkSession associated to webView.

Since: 2.40

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 WebViews, so modifying the settings of a WebView would affect other WebViews 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 Texture

Returns: an image with the retrieved snapshot, or Nothing in case of 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 Text

Returns: The main frame document title of webView.

Gets the value of the WebView:title property.

You can connect to notifytitle 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.

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::loadChanged 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 TLSErrorsPolicyIgnore, 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 TLSErrorsPolicyFail, 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 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::loadChanged is emitted with LoadEventRedirected event, the active URI is already updated to the redirected URI. </para></listitem> <listitem><para> When the signal WebView::loadChanged 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 notifyuri 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

getWebExtensionMode

webViewGetWebExtensionMode Source #

Arguments

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

webView: a WebView

-> m WebExtensionMode

Returns: the WebExtensionMode

Get the view's WebExtensionMode.

Since: 2.38

getWebsitePolicies

webViewGetWebsitePolicies Source #

Arguments

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

webView: a WebView

-> m WebsitePolicies

Returns: the default WebsitePolicies associated with the view.

Gets the default website policies.

Gets the default website policies set on construction in the webView. These can be overridden on a per-origin basis via the WebView::decidePolicy signal handler.

See also policyDecisionUseWithPolicies.

Since: 2.30

getWindowProperties

webViewGetWindowProperties Source #

Arguments

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

webView: a WebView

-> m WindowProperties

Returns: the WindowProperties of webView

Get the WindowProperties object.

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

Set the 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::loadChanged 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::loadChanged 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::loadChanged 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:isControlledByAutomation property enabled.

Only WebViews controlled by automation can be used in an automation session.

Since: 2.18

isEditable

webViewIsEditable Source #

Arguments

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

webView: a WebView

-> m Bool

Returns: True if the user is allowed to edit the HTML document, or False otherwise.

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

When webView is not editable an element in the HTML 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.

Since: 2.8

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:isLoading property.

You can monitor when a WebView is loading a page by connecting to notifyisLoading 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:isPlayingAudio property.

You can monitor when a page in a WebView is playing audio by connecting to the notifyisPlayingAudio 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::loadFailed 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::loadChanged 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::loadChanged 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::loadChanged 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::loadChanged 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::loadChanged signal.

new

webViewNew Source #

Arguments

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

Returns: The newly created WebView widget

Creates a new WebView with the default WebContext.

Creates a new WebView with the default WebContext and no UserContentManager associated with it. See also webkit_web_view_new_with_context(), webkit_web_view_new_with_user_content_manager(), and webkit_web_view_new_with_settings().

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

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.

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.

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.

sendMessageToPage

webViewSendMessageToPage Source #

Arguments

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

webView: a WebView

-> b

message: a UserMessage

-> Maybe c

cancellable: a Cancellable or Nothing to ignore

-> Maybe AsyncReadyCallback

callback: (nullable): A AsyncReadyCallback to call when the request is satisfied or Nothing

-> m () 

Send message to the WebKitWebPage corresponding to webView.

If message is floating, it's consumed. If you don't expect any reply, or you simply want to ignore it, you can pass Nothing as callback. When the operation is finished, callback will be called. You can then call webViewSendMessageToPageFinish to get the message reply.

Since: 2.28

sendMessageToPageFinish

webViewSendMessageToPageFinish Source #

Arguments

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

webView: a WebView

-> b

result: a AsyncResult

-> m UserMessage

Returns: a UserMessage with the reply or Nothing in case of error. (Can throw GError)

Finish an asynchronous operation started with webViewSendMessageToPage.

Since: 2.28

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.

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.

c code

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);
}

Since: 2.8

setCameraCaptureState

webViewSetCameraCaptureState Source #

Arguments

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

webView: a WebView

-> MediaCaptureState

state: a MediaCaptureState

-> m () 

Set the camera capture state of a WebView.

If Settings:enable-mediastream is False, this method will have no visible effect. Once the state of the device has been set to MediaCaptureStateNone it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Since: 2.34

setCorsAllowlist

webViewSetCorsAllowlist Source #

Arguments

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

webView: a WebView

-> Maybe [Text]

allowlist: an allowlist of URI patterns, or Nothing

-> m () 

Sets the allowlist for CORS.

Sets the allowlist for which Cross-Origin Resource Sharing checks are disabled in webView. URI patterns must be of the form [protocol]://[host]/[path], each component may contain the wildcard character (*) to represent zero or more other characters. All three components are required and must not be omitted from the URI patterns.

Disabling CORS checks permits resources from other origins to load allowlisted resources. It does not permit the allowlisted resources to load resources from other origins.

If this function is called multiple times, only the allowlist set by the most recent call will be effective.

Since: 2.34

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.

setDisplayCaptureState

webViewSetDisplayCaptureState Source #

Arguments

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

webView: a WebView

-> MediaCaptureState

state: a MediaCaptureState

-> m () 

Set the display capture state of a WebView.

If Settings:enable-mediastream is False, this method will have no visible effect. Once the state of the device has been set to MediaCaptureStateNone it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Since: 2.34

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

setInputMethodContext

webViewSetInputMethodContext Source #

Arguments

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

webView: a WebView

-> Maybe b

context: the InputMethodContext to set, or Nothing

-> m () 

Set the InputMethodContext to be used by webView.

Set the InputMethodContext to be used by webView, or Nothing to not use any input method. Note that the same InputMethodContext can't be set on more than one WebView at the same time.

Since: 2.28

setIsMuted

webViewSetIsMuted Source #

Arguments

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

webView: a WebView

-> Bool

muted: mute flag

-> m () 

Sets the mute state of webView.

Since: 2.30

setMicrophoneCaptureState

webViewSetMicrophoneCaptureState Source #

Arguments

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

webView: a WebView

-> MediaCaptureState

state: a MediaCaptureState

-> m () 

Set the microphone capture state of a WebView.

If Settings:enable-mediastream is False, this method will have no visible effect. Once the state of the device has been set to MediaCaptureStateNone it cannot be changed anymore. The page can however request capture again using the mediaDevices API.

Since: 2.34

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 WebViews.

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.

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::loadFailed signal will be emitted with NetworkErrorCancelled error.

terminateWebProcess

webViewTerminateWebProcess Source #

Arguments

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

webView: a WebView

-> m () 

Terminates the web process associated to webView.

When the web process gets terminated using this method, the WebView::webProcessTerminated signal is emitted with WebProcessTerminationReasonTerminatedByApi as the reason for termination.

Since: 2.34

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

automationPresentationType

The AutomationBrowsingContextPresentation of WebView. This should only be used when creating a new WebView as a response to AutomationSession::createWebView signal request. If the new WebView was added to a new tab of current browsing context window AutomationBrowsingContextPresentationTab should be used.

Since: 2.28

constructWebViewAutomationPresentationType :: (IsWebView o, MonadIO m) => AutomationBrowsingContextPresentation -> m (GValueConstruct o) Source #

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

getWebViewAutomationPresentationType :: (MonadIO m, IsWebView o) => o -> m AutomationBrowsingContextPresentation Source #

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

get webView #automationPresentationType

cameraCaptureState

Capture state of the camera device. Whenever the user grants a media-request sent by the web page, requesting video capture capabilities (navigator.mediaDevices.getUserMedia({video: true})) this property will be set to MediaCaptureStateActive.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureStateNone or MediaCaptureStateMuted.

If the capture state of the device is set to MediaCaptureStateNone the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Since: 2.34

constructWebViewCameraCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o) Source #

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

getWebViewCameraCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState Source #

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

get webView #cameraCaptureState

setWebViewCameraCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m () Source #

Set the value of the “camera-capture-state” property. When overloading is enabled, this is equivalent to

set webView [ #cameraCaptureState := value ]

defaultContentSecurityPolicy

The default Content-Security-Policy used by the webview as if it were set by an HTTP header.

This applies to all content loaded including through navigation or via the various webkit_web_view_load_\* APIs. However do note that many WebKit APIs bypass Content-Security-Policy in general such as UserContentManager and webkit_web_view_run_javascript().

Policies are additive so if a website sets its own policy it still applies on top of the policy set here.

Since: 2.38

constructWebViewDefaultContentSecurityPolicy :: (IsWebView o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

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

Get the value of the “default-content-security-policy” property. When overloading is enabled, this is equivalent to

get webView #defaultContentSecurityPolicy

displayCaptureState

Capture state of the display device. Whenever the user grants a media-request sent by the web page, requesting screencasting capabilities (`navigator.mediaDevices.getDisplayMedia() this property will be set to MediaCaptureStateActive.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureStateNone or MediaCaptureStateMuted.

If the capture state of the device is set to MediaCaptureStateNone the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Since: 2.34

constructWebViewDisplayCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o) Source #

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

getWebViewDisplayCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState Source #

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

get webView #displayCaptureState

setWebViewDisplayCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m () Source #

Set the value of the “display-capture-state” property. When overloading is enabled, this is equivalent to

set webView [ #displayCaptureState := value ]

editable

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

Since: 2.8

constructWebViewEditable :: (IsWebView o, MonadIO m) => Bool -> m (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 Texture 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::createWebView signal request.

Since: 2.18

constructWebViewIsControlledByAutomation :: (IsWebView o, MonadIO m) => Bool -> m (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

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::loadChanged 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::loadChanged 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

isMuted

Whether the WebView audio is muted. When True, audio is silenced. It may still be playing, i.e. WebView:isPlayingAudio may be True.

Since: 2.30

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

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

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

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

get webView #isMuted

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

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

set webView [ #isMuted := value ]

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

isWebProcessResponsive

Whether the web process currently associated to the WebView is responsive.

Since: 2.34

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

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

get webView #isWebProcessResponsive

microphoneCaptureState

Capture state of the microphone device. Whenever the user grants a media-request sent by the web page, requesting audio capture capabilities (navigator.mediaDevices.getUserMedia({audio: true})) this property will be set to MediaCaptureStateActive.

The application can monitor this property and provide a visual indicator allowing to optionally deactivate or mute the capture device by setting this property respectively to MediaCaptureStateNone or MediaCaptureStateMuted.

If the capture state of the device is set to MediaCaptureStateNone the web-page can still re-request the permission to the user. Permission desision caching is left to the application.

Since: 2.34

constructWebViewMicrophoneCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o) Source #

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

getWebViewMicrophoneCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState Source #

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

get webView #microphoneCaptureState

setWebViewMicrophoneCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m () Source #

Set the value of the “microphone-capture-state” property. When overloading is enabled, this is equivalent to

set webView [ #microphoneCaptureState := value ]

networkSession

The NetworkSession of the view

Since: 2.40

constructWebViewNetworkSession :: (IsWebView o, MonadIO m, IsNetworkSession a) => a -> m (GValueConstruct o) Source #

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

getWebViewNetworkSession :: (MonadIO m, IsWebView o) => o -> m NetworkSession Source #

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

get webView #networkSession

pageId

The identifier of the WebKitWebPage corresponding to the WebView.

Since: 2.28

getWebViewPageId :: (MonadIO m, IsWebView o) => o -> m Word64 Source #

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

get webView #pageId

relatedView

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

Since: 2.4

constructWebViewRelatedView :: (IsWebView o, MonadIO m, IsWebView a) => a -> m (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, MonadIO m, IsSettings a) => a -> m (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 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 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, MonadIO m, IsUserContentManager a) => a -> m (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, MonadIO m, IsWebContext a) => a -> m (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

webExtensionMode

This configures webView to treat the content as a WebExtension.

Note that this refers to the web standard WebExtensions and not WebKitWebExtensions.

In practice this limits the Content-Security-Policies that are allowed to be set. Some details can be found in Chrome's documentation.

Since: 2.38

constructWebViewWebExtensionMode :: (IsWebView o, MonadIO m) => WebExtensionMode -> m (GValueConstruct o) Source #

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

getWebViewWebExtensionMode :: (MonadIO m, IsWebView o) => o -> m WebExtensionMode Source #

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

get webView #webExtensionMode

websitePolicies

The WebsitePolicies for the view.

Since: 2.30

constructWebViewWebsitePolicies :: (IsWebView o, MonadIO m, IsWebsitePolicies a) => a -> m (GValueConstruct o) Source #

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

getWebViewWebsitePolicies :: (MonadIO m, IsWebView o) => o -> m WebsitePolicies Source #

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

get webView #websitePolicies

zoomLevel

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

constructWebViewZoomLevel :: (IsWebView o, MonadIO m) => Double -> m (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 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 -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewAuthenticate :: (IsWebView a, MonadIO m) => a -> ((?self :: 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 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 -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewClose :: (IsWebView a, MonadIO m) => a -> ((?self :: 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 WebViewContextMenuCallback Source #

Arguments

 = ContextMenu

contextMenu: the proposed ContextMenu

-> 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 ContextMenuItems 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 GtkMenu 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>

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 -> ((?self :: a) => WebViewContextMenuCallback) -> m SignalHandlerId Source #

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

after webView #contextMenu callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #contextMenu callback

contextMenuDismissed

type WebViewContextMenuDismissedCallback = IO () Source #

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

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

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

after webView #contextMenuDismissed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #contextMenuDismissed callback

create

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.

The new WebView must be related to webView, see WebView:relatedView for more details.

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

afterWebViewCreate :: (IsWebView a, MonadIO m) => a -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewCreate :: (IsWebView a, MonadIO m) => a -> ((?self :: 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 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:

c code

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 webkit_policy_decision_use()
        return FALSE;
    }
    return TRUE;
}

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 -> ((?self :: a) => WebViewDecidePolicyCallback) -> m SignalHandlerId Source #

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

after webView #decidePolicy callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #decidePolicy callback

enterFullscreen

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 -> ((?self :: a) => WebViewEnterFullscreenCallback) -> m SignalHandlerId Source #

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

after webView #enterFullscreen callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #enterFullscreen callback

insecureContentDetected

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 -> ((?self :: a) => WebViewInsecureContentDetectedCallback) -> m SignalHandlerId Source #

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

after webView #insecureContentDetected callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #insecureContentDetected callback

leaveFullscreen

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::enterFullscreen stage for instance.

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

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

after webView #leaveFullscreen callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #leaveFullscreen callback

loadChanged

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::loadFailed signal is emitted before WebView::loadChanged 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.

c code

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;
    }
}

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

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

after webView #loadChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #loadChanged callback

loadFailed

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 WebKitWebViewloadChanged 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 -> ((?self :: a) => WebViewLoadFailedCallback) -> m SignalHandlerId Source #

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

after webView #loadFailed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #loadFailed callback

loadFailedWithTlsErrors

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 webkit_web_context_allow_tls_certificate_for_host().

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

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

Since: 2.6

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

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

after webView #loadFailedWithTlsErrors callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #loadFailedWithTlsErrors callback

mouseTargetChanged

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 -> ((?self :: a) => WebViewMouseTargetChangedCallback) -> m SignalHandlerId Source #

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

after webView #mouseTargetChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #mouseTargetChanged callback

permissionRequest

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:

c code

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;
}

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 -> ((?self :: a) => WebViewPermissionRequestCallback) -> m SignalHandlerId Source #

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

after webView #permissionRequest callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #permissionRequest callback

print

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 -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewPrint :: (IsWebView a, MonadIO m) => a -> ((?self :: 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

queryPermissionState

type WebViewQueryPermissionStateCallback Source #

Arguments

 = PermissionStateQuery

query: the PermissionStateQuery

-> IO Bool

Returns: True if the message was handled, or False otherwise.

This signal allows the User-Agent to respond to permission requests for powerful features, as specified by the Permissions W3C Specification. You can reply to the query using permissionStateQueryFinish.

You can handle the query asynchronously by calling permissionStateQueryRef on query and returning True. If the last reference of query is removed and the query has not been handled, the query result will be set to WEBKIT_QUERY_PERMISSION_PROMPT.

Since: 2.40

afterWebViewQueryPermissionState :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewQueryPermissionStateCallback) -> m SignalHandlerId Source #

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

after webView #queryPermissionState callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewQueryPermissionState :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewQueryPermissionStateCallback) -> m SignalHandlerId Source #

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

on webView #queryPermissionState callback

readyToShow

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 -> ((?self :: a) => WebViewReadyToShowCallback) -> m SignalHandlerId Source #

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

after webView #readyToShow callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #readyToShow callback

resourceLoadStarted

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 -> ((?self :: a) => WebViewResourceLoadStartedCallback) -> m SignalHandlerId Source #

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

after webView #resourceLoadStarted callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #resourceLoadStarted callback

runAsModal

type WebViewRunAsModalCallback = IO () Source #

Emitted after WebView::readyToShow 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 -> ((?self :: a) => WebViewRunAsModalCallback) -> m SignalHandlerId Source #

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

after webView #runAsModal callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #runAsModal callback

runColorChooser

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 <input type='color' /> 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 -> ((?self :: a) => WebViewRunColorChooserCallback) -> m SignalHandlerId Source #

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

after webView #runColorChooser callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #runColorChooser callback

runFileChooser

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 <input type='file' /> 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 -> ((?self :: a) => WebViewRunFileChooserCallback) -> m SignalHandlerId Source #

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

after webView #runFileChooser callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #runFileChooser callback

scriptDialog

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 -> ((?self :: a) => WebViewScriptDialogCallback) -> m SignalHandlerId Source #

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

after webView #scriptDialog callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #scriptDialog callback

showNotification

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 -> ((?self :: a) => WebViewShowNotificationCallback) -> m SignalHandlerId Source #

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

after webView #showNotification callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #showNotification callback

showOptionMenu

type WebViewShowOptionMenuCallback Source #

Arguments

 = OptionMenu

menu: the OptionMenu

-> 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. To handle this signal asynchronously you should keep a ref of the menu.

The default signal handler will pop up a GtkMenu.

Since: 2.18

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

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

after webView #showOptionMenu callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #showOptionMenu callback

submitForm

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 -> ((?self :: a) => WebViewSubmitFormCallback) -> m SignalHandlerId Source #

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

after webView #submitForm callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #submitForm callback

userMessageReceived

type WebViewUserMessageReceivedCallback Source #

Arguments

 = UserMessage

message: the UserMessage received

-> IO Bool

Returns: True if the message was handled, or False otherwise.

This signal is emitted when a UserMessage is received from the WebKitWebPage corresponding to webView. You can reply to the message using userMessageSendReply.

You can handle the user message asynchronously by calling objectRef on message and returning True. If the last reference of message is removed and the message has not been replied to, the operation in the WebKitWebPage will finish with error UserMessageErrorMessage.

Since: 2.28

afterWebViewUserMessageReceived :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewUserMessageReceivedCallback) -> m SignalHandlerId Source #

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

after webView #userMessageReceived callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onWebViewUserMessageReceived :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewUserMessageReceivedCallback) -> m SignalHandlerId Source #

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

on webView #userMessageReceived callback

webProcessTerminated

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 -> ((?self :: a) => WebViewWebProcessTerminatedCallback) -> m SignalHandlerId Source #

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

after webView #webProcessTerminated callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

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

on webView #webProcessTerminated callback