webkit-0.12.6.1: Binding to the Webkit library.

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.WebKit.WebView

Contents

- Description
- Types
- Enums
- Constructors
- Methods
  - Load
  - Reload
  - History
  - Zoom
  - Clipboard
  - Undo/Redo
  - Selection
  - Encoding
  - View Mode
  - Transparent
  - Target List
  - Text Match
  - Icon
  - Other
- Attributes
- Signals
  - Loading
  - Clipboard
  - Script
  - Selection/edition
  - Decision request
  - Display
  - Other

Description

Note:

Signal `window-object-cleared` can't be bound now, because it needs JavaScriptCore that hasn't binding.

Signal `create-plugin-widget` can't be bound now, no idea how to bind `GHaskellTable`

- TODO:

Binding for webkit_web_view_get_snapshot

Synopsis

- data WebView
- class ContainerClass o => WebViewClass o
- data NavigationResponse
  - = NavigationResponseAccept
  - | NavigationResponseIgnore
  - | NavigationResponseDownload
- data TargetInfo
  - = WebViewTargetInfoHtml
  - | WebViewTargetInfoText
  - | WebViewTargetInfoImage
  - | WebViewTargetInfoUriList
  - | WebViewTargetInfoNetscapeUrl
- data LoadStatus
  - = LoadProvisional
  - | LoadCommitted
  - | LoadFinished
  - | LoadFirstVisuallyNonEmptyLayout
  - | LoadFailed
- data ViewMode
  - = WebViewViewModeWindowed
  - | WebViewViewModeFloating
  - | WebViewViewModeFullscreen
  - | WebViewViewModeMaximized
  - | WebViewViewModeMinimized
- webViewNew :: IO WebView
- webViewLoadUri :: WebViewClass self => self -> String -> IO ()
- webViewLoadHtmlString :: WebViewClass self => self -> String -> String -> IO ()
- webViewLoadRequest :: (WebViewClass self, NetworkRequestClass request) => self -> request -> IO ()
- webViewLoadString :: WebViewClass self => self -> String -> Maybe String -> Maybe String -> String -> IO ()
- webViewGetLoadStatus :: WebViewClass self => self -> IO LoadStatus
- webViewStopLoading :: WebViewClass self => self -> IO ()
- webViewReload :: WebViewClass self => self -> IO ()
- webViewReloadBypassCache :: WebViewClass self => self -> IO ()
- webViewCanGoBack :: WebViewClass self => self -> IO Bool
- webViewCanGoForward :: WebViewClass self => self -> IO Bool
- webViewGoBack :: WebViewClass self => self -> IO ()
- webViewGoForward :: WebViewClass self => self -> IO ()
- webViewGetBackForwardList :: WebViewClass self => self -> IO WebBackForwardList
- webViewSetMaintainsBackForwardList :: WebViewClass self => self -> Bool -> IO ()
- webViewGoToBackForwardItem :: (WebViewClass self, WebHistoryItemClass item) => self -> item -> IO Bool
- webViewCanGoBackOrForward :: WebViewClass self => self -> Int -> IO Bool
- webViewGoBackOrForward :: WebViewClass self => self -> Int -> IO ()
- webViewGetZoomLevel :: WebViewClass self => self -> IO Float
- webViewSetZoomLevel :: WebViewClass self => self -> Float -> IO ()
- webViewZoomIn :: WebViewClass self => self -> IO ()
- webViewZoomOut :: WebViewClass self => self -> IO ()
- webViewGetFullContentZoom :: WebViewClass self => self -> IO Bool
- webViewSetFullContentZoom :: WebViewClass self => self -> Bool -> IO ()
- webViewCanCutClipboard :: WebViewClass self => self -> IO Bool
- webViewCanCopyClipboard :: WebViewClass self => self -> IO Bool
- webViewCanPasteClipboard :: WebViewClass self => self -> IO Bool
- webViewCutClipboard :: WebViewClass self => self -> IO ()
- webViewCopyClipboard :: WebViewClass self => self -> IO ()
- webViewPasteClipboard :: WebViewClass self => self -> IO ()
- webViewCanRedo :: WebViewClass self => self -> IO Bool
- webViewCanUndo :: WebViewClass self => self -> IO Bool
- webViewRedo :: WebViewClass self => self -> IO ()
- webViewUndo :: WebViewClass self => self -> IO ()
- webViewDeleteSelection :: WebViewClass self => self -> IO ()
- webViewHasSelection :: WebViewClass self => self -> IO Bool
- webViewSelectAll :: WebViewClass self => self -> IO ()
- webViewGetEncoding :: WebViewClass self => self -> IO (Maybe String)
- webViewSetCustomEncoding :: WebViewClass self => self -> Maybe String -> IO ()
- webViewGetCustomEncoding :: WebViewClass self => self -> IO (Maybe String)
- webViewGetViewMode :: WebView -> IO ViewMode
- webViewSetViewMode :: WebView -> ViewMode -> IO ()
- webViewGetViewSourceMode :: WebViewClass self => self -> IO Bool
- webViewSetViewSourceMode :: WebViewClass self => self -> Bool -> IO ()
- webViewGetTransparent :: WebViewClass self => self -> IO Bool
- webViewSetTransparent :: WebViewClass self => self -> Bool -> IO ()
- webViewGetCopyTargetList :: WebViewClass self => self -> IO (Maybe TargetList)
- webViewGetPasteTargetList :: WebViewClass self => self -> IO (Maybe TargetList)
- webViewMarkTextMatches :: WebViewClass self => self -> String -> Bool -> Int -> IO Int
- webViewUnMarkTextMatches :: WebViewClass self => self -> IO ()
- webViewSetHighlightTextMatches :: WebViewClass self => self -> Bool -> IO ()
- webViewGetIconUri :: WebViewClass self => self -> IO (Maybe String)
- webViewTryGetFaviconPixbuf :: WebView -> Int -> Int -> IO (Maybe Pixbuf)
- webViewExecuteScript :: WebViewClass self => self -> String -> IO ()
- webViewCanShowMimeType :: WebViewClass self => self -> String -> IO Bool
- webViewGetEditable :: WebViewClass self => self -> IO Bool
- webViewSetEditable :: WebViewClass self => self -> Bool -> IO ()
- webViewGetInspector :: WebViewClass self => self -> IO WebInspector
- webViewGetProgress :: WebViewClass self => self -> IO Double
- webViewSearchText :: WebViewClass self => self -> String -> Bool -> Bool -> Bool -> IO Bool
- webViewMoveCursor :: WebViewClass self => self -> MovementStep -> Int -> IO ()
- webViewGetMainFrame :: WebViewClass self => self -> IO WebFrame
- webViewGetFocusedFrame :: WebViewClass self => self -> IO (Maybe WebFrame)
- webViewSetWebSettings :: (WebViewClass self, WebSettingsClass settings) => self -> settings -> IO ()
- webViewGetWebSettings :: WebViewClass self => self -> IO WebSettings
- webViewGetWindowFeatures :: WebViewClass self => self -> IO WebWindowFeatures
- webViewGetTitle :: WebViewClass self => self -> IO (Maybe String)
- webViewGetUri :: WebViewClass self => self -> IO (Maybe String)
- webViewGetDomDocument :: WebView -> IO (Maybe Document)
- webViewZoomLevel :: WebViewClass self => Attr self Float
- webViewFullContentZoom :: WebViewClass self => Attr self Bool
- webViewEncoding :: WebViewClass self => ReadAttr self (Maybe String)
- webViewCustomEncoding :: WebViewClass self => Attr self (Maybe String)
- webViewLoadStatus :: WebViewClass self => ReadAttr self LoadStatus
- webViewProgress :: WebViewClass self => ReadAttr self Double
- webViewTitle :: WebViewClass self => ReadAttr self (Maybe String)
- webViewInspector :: WebViewClass self => ReadAttr self WebInspector
- webViewWebSettings :: WebViewClass self => Attr self WebSettings
- webViewViewSourceMode :: WebViewClass self => Attr self Bool
- webViewTransparent :: WebViewClass self => Attr self Bool
- webViewEditable :: WebViewClass self => Attr self Bool
- webViewUri :: WebViewClass self => ReadAttr self (Maybe String)
- webViewCopyTargetList :: WebViewClass self => ReadAttr self (Maybe TargetList)
- webViewPasteTargetList :: WebViewClass self => ReadAttr self (Maybe TargetList)
- webViewWindowFeatures :: WebViewClass self => Attr self WebWindowFeatures
- webViewIconUri :: WebViewClass self => ReadAttr self String
- webViewImContext :: WebViewClass self => ReadAttr self IMContext
- loadStarted :: WebViewClass self => Signal self (WebFrame -> IO ())
- loadCommitted :: WebViewClass self => Signal self (WebFrame -> IO ())
- progressChanged :: WebViewClass self => Signal self (Int -> IO ())
- loadFinished :: WebViewClass self => Signal self (WebFrame -> IO ())
- loadError :: WebViewClass self => Signal self (WebFrame -> String -> GError -> IO Bool)
- iconLoaded :: WebViewClass self => Signal self (String -> IO ())
- documentLoadFinished :: WebViewClass self => Signal self (WebFrame -> IO ())
- resourceRequestStarting :: WebViewClass self => Signal self (WebFrame -> WebResource -> Maybe NetworkRequest -> Maybe NetworkResponse -> IO ())
- titleChanged :: WebViewClass self => Signal self (WebFrame -> String -> IO ())
- copyClipboard :: WebViewClass self => Signal self (IO ())
- cutClipboard :: WebViewClass self => Signal self (IO ())
- pasteClipboard :: WebViewClass self => Signal self (IO ())
- consoleMessage :: WebViewClass self => Signal self (String -> String -> Int -> String -> IO Bool)
- scriptAlert :: WebViewClass self => Signal self (WebFrame -> String -> IO Bool)
- scriptConfirm :: WebViewClass self => Signal self (WebFrame -> String -> IO Bool)
- scriptPrompt :: WebViewClass self => Signal self (WebFrame -> String -> String -> IO Bool)
- statusBarTextChanged :: WebViewClass self => Signal self (String -> IO ())
- populatePopup :: WebViewClass self => Signal self (Menu -> IO ())
- editingBegan :: WebViewClass self => Signal self (IO ())
- editingEnded :: WebViewClass self => Signal self (IO ())
- selectAll :: WebViewClass self => Signal self (IO ())
- selectionChanged :: WebViewClass self => Signal self (IO ())
- mimeTypePolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> String -> WebPolicyDecision -> IO Bool)
- navigationPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> WebNavigationAction -> WebPolicyDecision -> IO Bool)
- newWindowPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> WebNavigationAction -> WebPolicyDecision -> IO Bool)
- geolocationPolicyDecisionCancelled :: WebViewClass self => Signal self (WebFrame -> IO ())
- geolocationPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> GeolocationPolicyDecision -> IO Bool)
- moveCursor :: WebViewClass self => Signal self (MovementStep -> Int -> IO Bool)
- setScrollAdjustments :: WebViewClass self => Signal self (Adjustment -> Adjustment -> IO ())
- hoveringOverLink :: WebViewClass self => Signal self (Maybe String -> Maybe String -> IO ())
- createWebView :: WebViewClass self => Signal self (WebFrame -> IO WebView)
- webViewReady :: WebViewClass self => Signal self (IO Bool)
- closeWebView :: WebViewClass self => Signal self (IO Bool)
- printRequested :: WebViewClass self => Signal self (WebFrame -> IO Bool)
- databaseQuotaExceeded :: WebViewClass self => Signal self (WebFrame -> WebDatabase -> IO ())
- downloadRequested :: WebViewClass self => Signal self (Download -> IO Bool)
- redo :: WebViewClass self => Signal self (IO ())
- undo :: WebViewClass self => Signal self (IO ())

# Description

Cf http:

# Types

data WebView

Instances

Eq WebView |
Ord WebView |
GObjectClass WebView |
ObjectClass WebView |
WidgetClass WebView |
ContainerClass WebView |
WebViewClass WebView |

class ContainerClass o => WebViewClass o

Instances

WebViewClass WebView |

# Enums

data NavigationResponse

Constructors

NavigationResponseAccept |
NavigationResponseIgnore |
NavigationResponseDownload |

Instances

Enum NavigationResponse |
Eq NavigationResponse |
Show NavigationResponse |

data TargetInfo

Constructors

WebViewTargetInfoHtml |
WebViewTargetInfoText |
WebViewTargetInfoImage |
WebViewTargetInfoUriList |
WebViewTargetInfoNetscapeUrl |

Instances

Enum TargetInfo |
Eq TargetInfo |
Show TargetInfo |

data LoadStatus

Constructors

LoadProvisional |
LoadCommitted |
LoadFinished |
LoadFirstVisuallyNonEmptyLayout |
LoadFailed |

Instances

Enum LoadStatus |
Eq LoadStatus |
Show LoadStatus |

data ViewMode

Constructors

WebViewViewModeWindowed |
WebViewViewModeFloating |
WebViewViewModeFullscreen |
WebViewViewModeMaximized |
WebViewViewModeMinimized |

Instances

Enum ViewMode |
Eq ViewMode |
Show ViewMode |

# Constructors

webViewNew :: IO WebView

Create a new `WebView` widget.

It is a `Widget` you can embed in a `ScrolledWindow`.

You can load any URI into the `WebView` or any kind of data string.

# Methods

## Load

webViewLoadUri :: WebViewClass self => self -> String -> IO ()

Requests loading of the specified URI string in a `WebView`

webViewLoadHtmlString

Arguments

:: WebViewClass self |
=> self |
-> String | `content` - the html string
-> String | `base_uri` - the base URI
-> IO () |

Loading the `content` string as html. The URI passed in base_uri has to be an absolute URI. Deprecated since webkit v1.1.1, use `webViewLoadString` instead.

webViewLoadRequest :: (WebViewClass self, NetworkRequestClass request) => self -> request -> IO ()

Requests loading of the specified asynchronous client request. Creates a provisional data source that will transition to a committed data source once any data has been received. Use `webViewStopLoading` to stop the load.

webViewLoadString

Arguments

:: WebViewClass self |
=> self |
-> String | `content` - the content string to be loaded.
-> Maybe String | `mime_type` - the MIME type or `Nothing`.
-> Maybe String | `encoding` - the encoding or `Nothing`.
-> String | `base_uri` - the base URI for relative locations.
-> IO () |

Requests loading of the given `content` with the specified `mime_type`, `encoding` and `base_uri`. If `mime_type` is `Nothing`, "text/html" is assumed. If `encoding` is `Nothing`, UTF-8 is assumed.

webViewGetLoadStatus :: WebViewClass self => self -> IO LoadStatus

Determines the current status of the load.

## Reload

webViewStopLoading :: WebViewClass self => self -> IO ()

Stops and pending loads on the given data source.

webViewReload :: WebViewClass self => self -> IO ()

Reloads the `WebView`

webViewReloadBypassCache :: WebViewClass self => self -> IO ()

Reloads the `WebView` without using any cached data.

## History

webViewCanGoBack

Arguments

:: WebViewClass self |
=> self |
-> IO Bool | True if able to move back, False otherwise.

Determine whether `WebView` has a previous history item.

webViewCanGoForward

Arguments

:: WebViewClass self |
=> self |
-> IO Bool | True if able to move forward, False otherwise.

Determine whether `WebView` has a next history item.

webViewGoBack :: WebViewClass self => self -> IO ()

Loads the previous history item.

webViewGoForward :: WebViewClass self => self -> IO ()

Loads the next history item.

webViewGetBackForwardList :: WebViewClass self => self -> IO WebBackForwardList

Return the `WebBackForwardList`

webViewSetMaintainsBackForwardList

Arguments

:: WebViewClass self |
=> self |
-> Bool | `flag` - to tell the view to maintain a back or forward list.
-> IO () |

Set the `WebView` to maintian a back or forward list of history items.

webViewGoToBackForwardItem

Arguments

:: (WebViewClass self, WebHistoryItemClass item) |
=> self |
-> item |
-> IO Bool | True if loading of item is successful, False if not.

Go to the specified `WebHistoryItem`

webViewCanGoBackOrForward

Arguments

:: WebViewClass self |
=> self |
-> Int | `steps` - the number of steps
-> IO Bool | True if able to move back or forward the given number of steps, False otherwise

Determines whether `WebView` has a history item of `steps`.

Negative values represent steps backward while positive values represent steps forward

webViewGoBackOrForward :: WebViewClass self => self -> Int -> IO ()

Loads the history item that is the number of `steps` away from the current item. Negative values represent steps backward while positive values represent steps forward.

## Zoom

webViewGetZoomLevel :: WebViewClass self => self -> IO Float

Returns the zoom level of `WebView` i.e. the factor by which elements in the page are scaled with respect to their original size.

webViewSetZoomLevel

Arguments

:: WebViewClass self |
=> self |
-> Float | `zoom_level` - the new zoom level
-> IO () |

Sets the zoom level of `WebView`.

webViewZoomIn :: WebViewClass self => self -> IO ()

Increases the zoom level of `WebView`.

webViewZoomOut :: WebViewClass self => self -> IO ()

Decreases the zoom level of `WebView`.

webViewGetFullContentZoom

Arguments

:: WebViewClass self |
=> self |
-> IO Bool | False if only text should be scaled(the default) True if the full content of the view should be scaled.

Returns whether the zoom level affects only text or all elements.

webViewSetFullContentZoom

Arguments

:: WebViewClass self |
=> self |
-> Bool | `full_content_zoom` - False if only text should be scaled (the default) True if the full content of the view should be scaled.
-> IO () |

Sets whether the zoom level affects only text or all elements.

## Clipboard

webViewCanCutClipboard :: WebViewClass self => self -> IO Bool

Determines whether can cuts the current selection inside `WebView` to the clipboard

webViewCanCopyClipboard :: WebViewClass self => self -> IO Bool

Determines whether can copies the current selection inside `WebView` to the clipboard

webViewCanPasteClipboard :: WebViewClass self => self -> IO Bool

Determines whether can pastes the current contents of the clipboard to the `WebView`

webViewCutClipboard :: WebViewClass self => self -> IO ()

Cuts the current selection inside `WebView` to the clipboard.

webViewCopyClipboard :: WebViewClass self => self -> IO ()

Copies the current selection inside `WebView` to the clipboard.

webViewPasteClipboard :: WebViewClass self => self -> IO ()

Pastes the current contents of the clipboard to the `WebView`

## Undo/Redo

webViewCanRedo :: WebViewClass self => self -> IO Bool

Determines whether or not it is currently possible to redo the last editing command in the view

webViewCanUndo :: WebViewClass self => self -> IO Bool

Determines whether or not it is currently possible to undo the last editing command in the view

webViewRedo :: WebViewClass self => self -> IO ()

Redoes the last editing command in the view, if possible.

webViewUndo :: WebViewClass self => self -> IO ()

Undoes the last editing command in the view, if possible.

## Selection

webViewDeleteSelection :: WebViewClass self => self -> IO ()

Deletes the current selection inside the `WebView`

webViewHasSelection :: WebViewClass self => self -> IO Bool

Determines whether text was selected

webViewSelectAll :: WebViewClass self => self -> IO ()

Attempts to select everything inside the `WebView`

## Encoding

webViewGetEncoding

Arguments

:: WebViewClass self |
=> self |
-> IO (Maybe String) | the default encoding or `Nothing` in case of failed

Returns the default encoding of the `WebView`

webViewSetCustomEncoding

Arguments

:: WebViewClass self |
=> self |
-> Maybe String | `encoding` - the new encoding, or `Nothing` to restore the default encoding.
-> IO () |

Sets the current `WebView` encoding, without modifying the default one, and reloads the page

webViewGetCustomEncoding

Arguments

:: WebViewClass self |
=> self |
-> IO (Maybe String) | the current encoding string or `Nothing` if there is none set.

Returns the current encoding of `WebView`,not the default encoding.

## View Mode

webViewGetViewMode :: WebView -> IO ViewMode

Gets the value of the "view-mode" property of the `WebView`

webViewSetViewMode :: WebView -> ViewMode -> IO ()

webViewGetViewSourceMode :: WebViewClass self => self -> IO Bool

Returns whether `WebView` is in view source mode

webViewSetViewSourceMode :: WebViewClass self => self -> Bool -> IO ()

Set whether the view should be in view source mode. Setting this mode to (!(0)) before loading a URI will display the source of the web page in a nice and readable format.

## Transparent

webViewGetTransparent :: WebViewClass self => self -> IO Bool

Returns whether the `WebView` has a transparent background

webViewSetTransparent :: WebViewClass self => self -> Bool -> IO ()

Sets whether the WebKitWebView has a transparent background.

Pass False to have the `WebView` draw a solid background (the default), otherwise pass True.

## Target List

webViewGetCopyTargetList :: WebViewClass self => self -> IO (Maybe TargetList)

This function returns the list of targets this `WebView` can provide for clipboard copying and as DND source. The targets in the list are added with values from the `WebViewTargetInfo` enum, using `targetListAdd` and `targetListAddTextTargets`.

webViewGetPasteTargetList :: WebViewClass self => self -> IO (Maybe TargetList)

This function returns the list of targets this `WebView` can provide for clipboard pasteing and as DND source. The targets in the list are added with values from the `WebViewTargetInfo` enum, using `targetListAdd` and `targetListAddTextTargets`.

## Text Match

webViewMarkTextMatches

Arguments

:: WebViewClass self |
=> self |
-> String | `string` - a string to look for
-> Bool | `case_sensitive` - whether to respect the case of text
-> Int | `limit` - the maximum number of strings to look for or 0 for all
-> IO Int | the number of strings highlighted

Attempts to highlight all occurances of string inside `WebView`

webViewUnMarkTextMatches :: WebViewClass self => self -> IO ()

Removes highlighting previously set by `webViewMarkTextMarches`

webViewSetHighlightTextMatches

Arguments

:: WebViewClass self |
=> self |
-> Bool | `highlight` - whether to highlight text matches
-> IO () |

Highlights text matches previously marked by `webViewMarkTextMatches`

## Icon

webViewGetIconUri :: WebViewClass self => self -> IO (Maybe String)

Obtains the URI for the favicon for the given WebKitWebView, or `Nothing` if there is none.

- Since 1.1.18

webViewTryGetFaviconPixbuf

Arguments

:: WebView |
-> Int | the desired width for the icon
-> Int | the desired height for the icon
-> IO (Maybe Pixbuf) | a new reference to a `Pixbuf`, or `Nothing`.

Obtains a GdkPixbuf of the favicon for the given `WebView`. This will return `Nothing` if there is no icon for the current `WebView` or if the icon is in the database but not available at the moment of this call. Use `webViewGetIconUri` if you need to distinguish these cases.

Usually you want to connect to WebKitWebView::icon-loaded and call this method in the callback.

See also `faviconDatabaseTryGetFaviconPixbuf`. Contrary to this function the icon database one returns the URL of the page containing the icon.

## Other

webViewExecuteScript

Arguments

:: WebViewClass self |
=> self |
-> String | `script` - script to be executed
-> IO () |

Execute the script specified by `script`

webViewCanShowMimeType

Arguments

:: WebViewClass self |
=> self |
-> String | `mimetype` - a MIME type
-> IO Bool | True if the `mimetype` can be displayed, otherwise False

Returns whether or not a `mimetype` can be displayed using this view.

webViewGetEditable :: WebViewClass self => self -> IO Bool

Returns whether the user is allowed to edit the document.

webViewSetEditable :: WebViewClass self => self -> Bool -> IO ()

Sets whether allows the user to edit its HTML document.

webViewGetInspector :: WebViewClass self => self -> IO WebInspector

Obtains the `WebInspector` associated with the `WebView`

webViewGetProgress

Arguments

:: WebViewClass self |
=> self |
-> IO Double | the load progress

Determines the current progress of the load

webViewSearchText

Arguments

:: WebViewClass self |
=> self |
-> String | `text` - a string to look for
-> Bool | `case_sensitive` - whether to respect the case of text
-> Bool | `forward` - whether to find forward or not
-> Bool | `wrap` - whether to continue looking at beginning after reaching the end
-> IO Bool | True on success or False on failure

Looks for a specified string inside `WebView`

webViewMoveCursor :: WebViewClass self => self -> MovementStep -> Int -> IO ()

Move the cursor in view as described by step and count.

webViewGetMainFrame :: WebViewClass self => self -> IO WebFrame

Return the main `WebFrame` of the given `WebView`.

webViewGetFocusedFrame :: WebViewClass self => self -> IO (Maybe WebFrame)

Return the focused `WebFrame` (if any) of the given `WebView`.

webViewSetWebSettings :: (WebViewClass self, WebSettingsClass settings) => self -> settings -> IO ()

Apply `WebSettings` to a given `WebView`

!!NOTE!!, currently lack of useful APIs of `WebSettings` in webkitgtk. If you want to set the encoding, font family or font size of the `WebView`, please use related functions.

webViewGetWebSettings :: WebViewClass self => self -> IO WebSettings

Return the `WebSettings` currently used by `WebView`.

webViewGetWindowFeatures :: WebViewClass self => self -> IO WebWindowFeatures

Returns the instance of WebKitWebWindowFeatures held by the given WebKitWebView.

webViewGetTitle :: WebViewClass self => self -> IO (Maybe String)

Returns the title of `WebView` document, or Nothing in case of failure

webViewGetUri :: WebViewClass self => self -> IO (Maybe String)

Returns the current URI of the contents displayed by the `WebView`, or Nothing in case of failure

webViewGetDomDocument :: WebView -> IO (Maybe Document)

# Attributes

webViewZoomLevel :: WebViewClass self => Attr self Float

Zoom level of the `WebView` instance

webViewFullContentZoom :: WebViewClass self => Attr self Bool

Whether the full content is scaled when zooming

Default value: False

webViewEncoding :: WebViewClass self => ReadAttr self (Maybe String)

The default encoding of the `WebView` instance

Default value: `Nothing`

webViewCustomEncoding :: WebViewClass self => Attr self (Maybe String)

The custom encoding of the `WebView` instance

Default value: `Nothing`

webViewLoadStatus :: WebViewClass self => ReadAttr self LoadStatus

Determines the current status of the load.

Default value: `LoadFinished`

webViewProgress :: WebViewClass self => ReadAttr self Double

Determines the current progress of the load

Default Value: 1

webViewTitle :: WebViewClass self => ReadAttr self (Maybe String)

Title of the `WebView` instance

webViewInspector :: WebViewClass self => ReadAttr self WebInspector

The associated webInspector instance of the `WebView`

webViewWebSettings :: WebViewClass self => Attr self WebSettings

The associated webSettings of the `WebView` instance

webViewViewSourceMode :: WebViewClass self => Attr self Bool

view source mode of the `WebView` instance

webViewTransparent :: WebViewClass self => Attr self Bool

transparent background of the `WebView` instance

webViewEditable :: WebViewClass self => Attr self Bool

Whether content of the `WebView` can be modified by the user

Default value: `False`

webViewUri :: WebViewClass self => ReadAttr self (Maybe String)

Returns the current URI of the contents displayed by the `web_view`.

Default value: Nothing

webViewCopyTargetList :: WebViewClass self => ReadAttr self (Maybe TargetList)

The list of targets this web view supports for clipboard copying.

webViewPasteTargetList :: WebViewClass self => ReadAttr self (Maybe TargetList)

The list of targets this web view supports for clipboard pasteing.

webViewWindowFeatures :: WebViewClass self => Attr self WebWindowFeatures

An associated `WebWindowFeatures` instance.

webViewIconUri :: WebViewClass self => ReadAttr self String

The URI for the favicon for the WebKitWebView.

Default value: `Nothing`

- Since 1.1.18

webViewImContext :: WebViewClass self => ReadAttr self IMContext

The `IMMulticontext` for the WebKitWebView.

This is the input method context used for all text entry widgets inside the WebKitWebView. It can be used to generate context menu items for controlling the active input method.

- Since 1.1.20

# Signals

## Loading

loadStarted :: WebViewClass self => Signal self (WebFrame -> IO ())

When a `WebFrame` begins to load, this signal is emitted

loadCommitted :: WebViewClass self => Signal self (WebFrame -> IO ())

When a `WebFrame` loaded the first data, this signal is emitted

progressChanged :: WebViewClass self => Signal self (Int -> IO ())

When the global progress changed, this signal is emitted

the global progress will be passed back to user function

loadFinished :: WebViewClass self => Signal self (WebFrame -> IO ())

When loading finished, this signal is emitted

loadError :: WebViewClass self => Signal self (WebFrame -> String -> GError -> IO Bool)

When An error occurred while loading.

By default, if the signal is not handled, the WebView will display a stock error page.

You need to handle the signal if you want to provide your own error page.

The URI that triggered the error and the `GError` will be passed back to user function.

iconLoaded :: WebViewClass self => Signal self (String -> IO ())

Emitted after Icon loaded

documentLoadFinished :: WebViewClass self => Signal self (WebFrame -> IO ())

When document loading finished, this signal is emitted

resourceRequestStarting :: WebViewClass self => Signal self (WebFrame -> WebResource -> Maybe NetworkRequest -> Maybe NetworkResponse -> IO ())

Emitted when a request is about to be sent. You can modify the request while handling this signal. You can set the URI in the `NetworkRequest` object itself, and addremovereplace headers using the SoupMessage object it carries, if it is present. See `networkRequestGetMessage`. Setting the request URI to "about:blank" will effectively cause the request to load nothing, and can be used to disable the loading of specific resources.

Notice that information about an eventual redirect is available in response's SoupMessage, not in the SoupMessage carried by the request. If response is ((void *)0), then this is not a redirected request.

The `WebResource` object will be the same throughout all the lifetime of the resource, but the contents may change from inbetween signal emissions.

titleChanged :: WebViewClass self => Signal self (WebFrame -> String -> IO ())

When Document title changed, this signal is emitted.

It can be used to set the Application `Window` title.

webframe - which `WebFrame` changes the document title.

title - current title string.

## Clipboard

copyClipboard :: WebViewClass self => Signal self (IO ())

The `copyClipboard` signal is a keybinding signal which gets emitted to copy the selection to the clipboard.

The default bindings for this signal are Ctrl-c and Ctrl-Insert.

cutClipboard :: WebViewClass self => Signal self (IO ())

The `cutClipboard` signal is a keybinding signal which gets emitted to cut the selection to the clipboard.

The default bindings for this signal are Ctrl-x and Shift-Delete.

pasteClipboard :: WebViewClass self => Signal self (IO ())

The `pasteClipboard` signal is a keybinding signal which gets emitted to paste the contents of the clipboard into the Web view.

The default bindings for this signal are Ctrl-v and Shift-Insert.

## Script

consoleMessage :: WebViewClass self => Signal self (String -> String -> Int -> String -> IO Bool)

A JavaScript console message was created.

scriptAlert :: WebViewClass self => Signal self (WebFrame -> String -> IO Bool)

A JavaScript alert dialog was created.

scriptConfirm :: WebViewClass self => Signal self (WebFrame -> String -> IO Bool)

A JavaScript confirm dialog was created, providing Yes and No buttons.

scriptPrompt :: WebViewClass self => Signal self (WebFrame -> String -> String -> IO Bool)

A JavaScript prompt dialog was created, providing an entry to input text.

statusBarTextChanged :: WebViewClass self => Signal self (String -> IO ())

When status-bar text changed, this signal will emitted.

populatePopup :: WebViewClass self => Signal self (Menu -> IO ())

When a context menu is about to be displayed this signal is emitted.

## Selection/edition

editingBegan :: WebViewClass self => Signal self (IO ())

editingEnded :: WebViewClass self => Signal self (IO ())

selectAll :: WebViewClass self => Signal self (IO ())

The `selectAll` signal is a keybinding signal which gets emitted to select the complete contents of the text view.

The default bindings for this signal is Ctrl-a.

selectionChanged :: WebViewClass self => Signal self (IO ())

When selection changed, this signal is emitted.

## Decision request

mimeTypePolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> String -> WebPolicyDecision -> IO Bool)

Decide whether or not to display the given MIME type. If this signal is not handled, the default behavior is to show the content of the requested URI if WebKit can show this MIME type and the content disposition is not a download; if WebKit is not able to show the MIME type nothing happens.

Notice that if you return True, meaning that you handled the signal, you are expected to be aware of the Content-Disposition header. A value of "attachment" usually indicates a download regardless of the MIME type, see also soupMessageHeadersGetContentDisposition' And you must call `webPolicyDecisionIgnore`, `webPolicyDecisionDownload`, or `webPolicyDecisionUse` on the `webPolicyDecision` object.

navigationPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> WebNavigationAction -> WebPolicyDecision -> IO Bool)

Emitted when frame requests a navigation to another page. If this signal is not handled, the default behavior is to allow the navigation.

Notice that if you return True, meaning that you handled the signal, you are expected to be aware of the Content-Disposition header. A value of "attachment" usually indicates a download regardless of the MIME type, see also soupMessageHeadersGetContentDisposition' And you must call `webPolicyDecisionIgnore`, `webPolicyDecisionDownload`, or `webPolicyDecisionUse` on the `webPolicyDecision` object.

newWindowPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> NetworkRequest -> WebNavigationAction -> WebPolicyDecision -> IO Bool)

Emitted when frame requests opening a new window. With this signal the browser can use the context of the request to decide about the new window. If the request is not handled the default behavior is to allow opening the new window to load the URI, which will cause a `createWebView` signal emission where the browser handles the new window action but without information of the context that caused the navigation. The following `navigationPolicyDecisionRequested` emissions will load the page after the creation of the new window just with the information of this new navigation context, without any information about the action that made this new window to be opened.

Notice that if you return True, meaning that you handled the signal, you are expected to be aware of the Content-Disposition header. A value of "attachment" usually indicates a download regardless of the MIME type, see also soupMessageHeadersGetContentDisposition' And you must call `webPolicyDecisionIgnore`, `webPolicyDecisionDownload`, or `webPolicyDecisionUse` on the `webPolicyDecision` object.

geolocationPolicyDecisionCancelled :: WebViewClass self => Signal self (WebFrame -> IO ())

When a frame wants to cancel geolocation permission it had requested before.

- Since 1.1.23

geolocationPolicyDecisionRequested :: WebViewClass self => Signal self (WebFrame -> GeolocationPolicyDecision -> IO Bool)

When a frame wants to get its geolocation permission. The receiver must reply with a boolean wether it handled or not the request. If the request is not handled, default behaviour is to deny geolocation.

- Since 1.1.23

## Display

moveCursor :: WebViewClass self => Signal self (MovementStep -> Int -> IO Bool)

The `moveCursor` will be emitted to apply the cursor movement described by its parameters to the view.

setScrollAdjustments :: WebViewClass self => Signal self (Adjustment -> Adjustment -> IO ())

When set scroll adjustments, this signal is emitted.

## Other

hoveringOverLink :: WebViewClass self => Signal self (Maybe String -> Maybe String -> IO ())

When the cursor is over a link, this signal is emitted.

title - the link's title or `Nothing` in case of failure.

uri - the URI the link points to or `Nothing` in case of failure.

createWebView :: WebViewClass self => Signal self (WebFrame -> IO WebView)

webViewReady :: WebViewClass self => Signal self (IO Bool)

Emitted after new `WebView` instance had been created in `onCreateWebView` user function when the new `WebView` should be displayed to the user.

All the information about how the window should look, including size,position,whether the location, status and scroll bars should be displayed, is ready set.

closeWebView :: WebViewClass self => Signal self (IO Bool)

Emitted when closing a WebView is requested.

This occurs when a call is made from JavaScript's window.close function. The default signal handler does not do anything. It is the owner's responsibility to hide or delete the `WebView`, if necessary.

User function should return True to stop the handlers from being invoked for the event or False to propagate the event furter

printRequested :: WebViewClass self => Signal self (WebFrame -> IO Bool)

Emitted when printing is requested by the frame, usually because of a javascript call. When handling this signal you should call `webFramePrintFull` or `webFramePrint` to do the actual printing.

The default handler will present a print dialog and carry a print operation. Notice that this means that if you intend to ignore a print request you must connect to this signal, and return True.

databaseQuotaExceeded :: WebViewClass self => Signal self (WebFrame -> WebDatabase -> IO ())

The `databaseQuotaExceeded` signal will be emitted when a Web Database exceeds the quota of its security origin. This signal may be used to increase the size of the quota before the originating operation fails.

downloadRequested :: WebViewClass self => Signal self (Download -> IO Bool)

Emitted after A new `Download` is being requested.

By default, if the signal is not handled, the download is cancelled.

Notice that while handling this signal you must set the target URI using `downloadSetDestinationUri`

If you intend to handle downloads yourself, return False in user function.

redo :: WebViewClass self => Signal self (IO ())

The "redo" signal is a keybinding signal which gets emitted to redo the last editing command.

The default binding for this signal is Ctrl-Shift-z

undo :: WebViewClass self => Signal self (IO ())

The "undo" signal is a keybinding signal which gets emitted to undo the last editing command.

The default binding for this signal is Ctrl-z