| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.WebKit2.Objects.WebView
Contents
- Exported types
- Methods
- callAsyncJavascriptFunction
- callAsyncJavascriptFunctionFinish
- canExecuteEditingCommand
- canExecuteEditingCommandFinish
- canGoBack
- canGoForward
- canShowMimeType
- downloadUri
- evaluateJavascript
- evaluateJavascriptFinish
- executeEditingCommand
- executeEditingCommandWithArgument
- getAutomationPresentationType
- getBackForwardList
- getBackgroundColor
- getCameraCaptureState
- getContext
- getCustomCharset
- getDefaultContentSecurityPolicy
- getDisplayCaptureState
- getEditorState
- getEstimatedLoadProgress
- getFavicon
- getFindController
- getInputMethodContext
- getInspector
- getIsMuted
- getIsWebProcessResponsive
- getMainResource
- getMicrophoneCaptureState
- getPageId
- getSessionState
- getSettings
- getSnapshot
- getSnapshotFinish
- getTitle
- getTlsInfo
- getUri
- getUserContentManager
- getWebExtensionMode
- getWebsiteDataManager
- getWebsitePolicies
- getWindowProperties
- getZoomLevel
- goBack
- goForward
- goToBackForwardListItem
- isControlledByAutomation
- isEditable
- isEphemeral
- isLoading
- isPlayingAudio
- loadAlternateHtml
- loadBytes
- loadHtml
- loadPlainText
- loadRequest
- loadUri
- new
- newWithContext
- newWithRelatedView
- newWithSettings
- newWithUserContentManager
- reload
- reloadBypassCache
- restoreSessionState
- runAsyncJavascriptFunctionInWorld
- runJavascript
- runJavascriptFinish
- runJavascriptFromGresource
- runJavascriptFromGresourceFinish
- runJavascriptInWorld
- runJavascriptInWorldFinish
- save
- saveFinish
- saveToFile
- saveToFileFinish
- sendMessageToPage
- sendMessageToPageFinish
- setBackgroundColor
- setCameraCaptureState
- setCorsAllowlist
- setCustomCharset
- setDisplayCaptureState
- setEditable
- setInputMethodContext
- setIsMuted
- setMicrophoneCaptureState
- setSettings
- setZoomLevel
- stopLoading
- terminateWebProcess
- tryClose
- Properties
- automationPresentationType
- cameraCaptureState
- defaultContentSecurityPolicy
- displayCaptureState
- editable
- estimatedLoadProgress
- favicon
- isControlledByAutomation
- isEphemeral
- isLoading
- isMuted
- isPlayingAudio
- isWebProcessResponsive
- microphoneCaptureState
- pageId
- relatedView
- settings
- title
- uri
- userContentManager
- webContext
- webExtensionMode
- websitePolicies
- zoomLevel
- Signals
- authenticate
- close
- contextMenu
- contextMenuDismissed
- create
- decidePolicy
- enterFullscreen
- insecureContentDetected
- leaveFullscreen
- loadChanged
- loadFailed
- loadFailedWithTlsErrors
- mouseTargetChanged
- permissionRequest
- queryPermissionState
- readyToShow
- resourceLoadStarted
- runAsModal
- runColorChooser
- runFileChooser
- scriptDialog
- showNotification
- showOptionMenu
- submitForm
- userMessageReceived
- webProcessCrashed
- webProcessTerminated
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
- newtype WebView = WebView (ManagedPtr WebView)
- class (GObject o, IsDescendantOf WebView o) => IsWebView o
- toWebView :: (MonadIO m, IsWebView o) => o -> m WebView
- webViewCallAsyncJavascriptFunction :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Int64 -> Maybe GVariant -> Maybe Text -> Maybe Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewCallAsyncJavascriptFunctionFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m Value
- webViewCanExecuteEditingCommand :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewCanExecuteEditingCommandFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m ()
- webViewCanGoBack :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewCanGoForward :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewCanShowMimeType :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> m Bool
- webViewDownloadUri :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> m Download
- webViewEvaluateJavascript :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Int64 -> Maybe Text -> Maybe Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewEvaluateJavascriptFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m Value
- webViewExecuteEditingCommand :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> m ()
- webViewExecuteEditingCommandWithArgument :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> Text -> m ()
- webViewGetAutomationPresentationType :: (HasCallStack, MonadIO m, IsWebView a) => a -> m AutomationBrowsingContextPresentation
- webViewGetBackForwardList :: (HasCallStack, MonadIO m, IsWebView a) => a -> m BackForwardList
- webViewGetBackgroundColor :: (HasCallStack, MonadIO m, IsWebView a) => a -> m RGBA
- webViewGetCameraCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> m MediaCaptureState
- webViewGetContext :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebContext
- webViewGetCustomCharset :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe Text)
- webViewGetDefaultContentSecurityPolicy :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe Text)
- webViewGetDisplayCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> m MediaCaptureState
- webViewGetEditorState :: (HasCallStack, MonadIO m, IsWebView a) => a -> m EditorState
- webViewGetEstimatedLoadProgress :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Double
- webViewGetFavicon :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe Surface)
- webViewGetFindController :: (HasCallStack, MonadIO m, IsWebView a) => a -> m FindController
- webViewGetInputMethodContext :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe InputMethodContext)
- webViewGetInspector :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebInspector
- webViewGetIsMuted :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewGetIsWebProcessResponsive :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewGetMainResource :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe WebResource)
- webViewGetMicrophoneCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> m MediaCaptureState
- webViewGetPageId :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Word64
- webViewGetSessionState :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebViewSessionState
- webViewGetSettings :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Settings
- webViewGetSnapshot :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> SnapshotRegion -> [SnapshotOptions] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewGetSnapshotFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m Surface
- webViewGetTitle :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe Text)
- webViewGetTlsInfo :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Bool, TlsCertificate, [TlsCertificateFlags])
- webViewGetUri :: (HasCallStack, MonadIO m, IsWebView a) => a -> m (Maybe Text)
- webViewGetUserContentManager :: (HasCallStack, MonadIO m, IsWebView a) => a -> m UserContentManager
- webViewGetWebExtensionMode :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebExtensionMode
- webViewGetWebsiteDataManager :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebsiteDataManager
- webViewGetWebsitePolicies :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebsitePolicies
- webViewGetWindowProperties :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WindowProperties
- webViewGetZoomLevel :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Double
- webViewGoBack :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewGoForward :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewGoToBackForwardListItem :: (HasCallStack, MonadIO m, IsWebView a, IsBackForwardListItem b) => a -> b -> m ()
- webViewIsControlledByAutomation :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewIsEditable :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewIsEphemeral :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewIsLoading :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewIsPlayingAudio :: (HasCallStack, MonadIO m, IsWebView a) => a -> m Bool
- webViewLoadAlternateHtml :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> Text -> Maybe Text -> m ()
- webViewLoadBytes :: (HasCallStack, MonadIO m, IsWebView a) => a -> Bytes -> Maybe Text -> Maybe Text -> Maybe Text -> m ()
- webViewLoadHtml :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> Maybe Text -> m ()
- webViewLoadPlainText :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> m ()
- webViewLoadRequest :: (HasCallStack, MonadIO m, IsWebView a, IsURIRequest b) => a -> b -> m ()
- webViewLoadUri :: (HasCallStack, MonadIO m, IsWebView a) => a -> Text -> m ()
- webViewNew :: (HasCallStack, MonadIO m) => m WebView
- webViewNewWithContext :: (HasCallStack, MonadIO m, IsWebContext a) => a -> m WebView
- webViewNewWithRelatedView :: (HasCallStack, MonadIO m, IsWebView a) => a -> m WebView
- webViewNewWithSettings :: (HasCallStack, MonadIO m, IsSettings a) => a -> m WebView
- webViewNewWithUserContentManager :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> m WebView
- webViewReload :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewReloadBypassCache :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewRestoreSessionState :: (HasCallStack, MonadIO m, IsWebView a) => a -> WebViewSessionState -> m ()
- webViewRunAsyncJavascriptFunctionInWorld :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> GVariant -> Maybe Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewRunJavascript :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewRunJavascriptFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m JavascriptResult
- webViewRunJavascriptFromGresource :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewRunJavascriptFromGresourceFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m JavascriptResult
- webViewRunJavascriptInWorld :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> Text -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewRunJavascriptInWorldFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m JavascriptResult
- webViewSave :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) => a -> SaveMode -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- webViewSaveFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m InputStream
- webViewSaveToFile :: (HasCallStack, MonadIO m, IsWebView a, IsFile b, IsCancellable c) => a -> b -> SaveMode -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- webViewSaveToFileFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m ()
- webViewSendMessageToPage :: (HasCallStack, MonadIO m, IsWebView a, IsUserMessage b, IsCancellable c) => a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- webViewSendMessageToPageFinish :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) => a -> b -> m UserMessage
- webViewSetBackgroundColor :: (HasCallStack, MonadIO m, IsWebView a) => a -> RGBA -> m ()
- webViewSetCameraCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> MediaCaptureState -> m ()
- webViewSetCorsAllowlist :: (HasCallStack, MonadIO m, IsWebView a) => a -> Maybe [Text] -> m ()
- webViewSetCustomCharset :: (HasCallStack, MonadIO m, IsWebView a) => a -> Maybe Text -> m ()
- webViewSetDisplayCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> MediaCaptureState -> m ()
- webViewSetEditable :: (HasCallStack, MonadIO m, IsWebView a) => a -> Bool -> m ()
- webViewSetInputMethodContext :: (HasCallStack, MonadIO m, IsWebView a, IsInputMethodContext b) => a -> Maybe b -> m ()
- webViewSetIsMuted :: (HasCallStack, MonadIO m, IsWebView a) => a -> Bool -> m ()
- webViewSetMicrophoneCaptureState :: (HasCallStack, MonadIO m, IsWebView a) => a -> MediaCaptureState -> m ()
- webViewSetSettings :: (HasCallStack, MonadIO m, IsWebView a, IsSettings b) => a -> b -> m ()
- webViewSetZoomLevel :: (HasCallStack, MonadIO m, IsWebView a) => a -> Double -> m ()
- webViewStopLoading :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewTerminateWebProcess :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- webViewTryClose :: (HasCallStack, MonadIO m, IsWebView a) => a -> m ()
- constructWebViewAutomationPresentationType :: (IsWebView o, MonadIO m) => AutomationBrowsingContextPresentation -> m (GValueConstruct o)
- getWebViewAutomationPresentationType :: (MonadIO m, IsWebView o) => o -> m AutomationBrowsingContextPresentation
- constructWebViewCameraCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o)
- getWebViewCameraCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState
- setWebViewCameraCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m ()
- constructWebViewDefaultContentSecurityPolicy :: (IsWebView o, MonadIO m) => Text -> m (GValueConstruct o)
- getWebViewDefaultContentSecurityPolicy :: (MonadIO m, IsWebView o) => o -> m (Maybe Text)
- constructWebViewDisplayCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o)
- getWebViewDisplayCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState
- setWebViewDisplayCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m ()
- constructWebViewEditable :: (IsWebView o, MonadIO m) => Bool -> m (GValueConstruct o)
- getWebViewEditable :: (MonadIO m, IsWebView o) => o -> m Bool
- setWebViewEditable :: (MonadIO m, IsWebView o) => o -> Bool -> m ()
- getWebViewEstimatedLoadProgress :: (MonadIO m, IsWebView o) => o -> m Double
- getWebViewFavicon :: (MonadIO m, IsWebView o) => o -> m (Ptr ())
- constructWebViewIsControlledByAutomation :: (IsWebView o, MonadIO m) => Bool -> m (GValueConstruct o)
- getWebViewIsControlledByAutomation :: (MonadIO m, IsWebView o) => o -> m Bool
- constructWebViewIsEphemeral :: (IsWebView o, MonadIO m) => Bool -> m (GValueConstruct o)
- getWebViewIsEphemeral :: (MonadIO m, IsWebView o) => o -> m Bool
- getWebViewIsLoading :: (MonadIO m, IsWebView o) => o -> m Bool
- constructWebViewIsMuted :: (IsWebView o, MonadIO m) => Bool -> m (GValueConstruct o)
- getWebViewIsMuted :: (MonadIO m, IsWebView o) => o -> m Bool
- setWebViewIsMuted :: (MonadIO m, IsWebView o) => o -> Bool -> m ()
- getWebViewIsPlayingAudio :: (MonadIO m, IsWebView o) => o -> m Bool
- getWebViewIsWebProcessResponsive :: (MonadIO m, IsWebView o) => o -> m Bool
- constructWebViewMicrophoneCaptureState :: (IsWebView o, MonadIO m) => MediaCaptureState -> m (GValueConstruct o)
- getWebViewMicrophoneCaptureState :: (MonadIO m, IsWebView o) => o -> m MediaCaptureState
- setWebViewMicrophoneCaptureState :: (MonadIO m, IsWebView o) => o -> MediaCaptureState -> m ()
- getWebViewPageId :: (MonadIO m, IsWebView o) => o -> m Word64
- constructWebViewRelatedView :: (IsWebView o, MonadIO m, IsWebView a) => a -> m (GValueConstruct o)
- constructWebViewSettings :: (IsWebView o, MonadIO m, IsSettings a) => a -> m (GValueConstruct o)
- setWebViewSettings :: (MonadIO m, IsWebView o, IsSettings a) => o -> a -> m ()
- getWebViewTitle :: (MonadIO m, IsWebView o) => o -> m (Maybe Text)
- getWebViewUri :: (MonadIO m, IsWebView o) => o -> m (Maybe Text)
- constructWebViewUserContentManager :: (IsWebView o, MonadIO m, IsUserContentManager a) => a -> m (GValueConstruct o)
- getWebViewUserContentManager :: (MonadIO m, IsWebView o) => o -> m UserContentManager
- constructWebViewWebContext :: (IsWebView o, MonadIO m, IsWebContext a) => a -> m (GValueConstruct o)
- getWebViewWebContext :: (MonadIO m, IsWebView o) => o -> m (Maybe WebContext)
- constructWebViewWebExtensionMode :: (IsWebView o, MonadIO m) => WebExtensionMode -> m (GValueConstruct o)
- getWebViewWebExtensionMode :: (MonadIO m, IsWebView o) => o -> m WebExtensionMode
- constructWebViewWebsitePolicies :: (IsWebView o, MonadIO m, IsWebsitePolicies a) => a -> m (GValueConstruct o)
- getWebViewWebsitePolicies :: (MonadIO m, IsWebView o) => o -> m WebsitePolicies
- constructWebViewZoomLevel :: (IsWebView o, MonadIO m) => Double -> m (GValueConstruct o)
- getWebViewZoomLevel :: (MonadIO m, IsWebView o) => o -> m Double
- setWebViewZoomLevel :: (MonadIO m, IsWebView o) => o -> Double -> m ()
- type WebViewAuthenticateCallback = AuthenticationRequest -> IO Bool
- afterWebViewAuthenticate :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewAuthenticateCallback) -> m SignalHandlerId
- onWebViewAuthenticate :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewAuthenticateCallback) -> m SignalHandlerId
- type WebViewCloseCallback = IO ()
- afterWebViewClose :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewCloseCallback) -> m SignalHandlerId
- onWebViewClose :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewCloseCallback) -> m SignalHandlerId
- type WebViewContextMenuCallback = ContextMenu -> Event -> HitTestResult -> IO Bool
- afterWebViewContextMenu :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewContextMenuCallback) -> m SignalHandlerId
- onWebViewContextMenu :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewContextMenuCallback) -> m SignalHandlerId
- type WebViewContextMenuDismissedCallback = IO ()
- afterWebViewContextMenuDismissed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewContextMenuDismissedCallback) -> m SignalHandlerId
- onWebViewContextMenuDismissed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewContextMenuDismissedCallback) -> m SignalHandlerId
- type WebViewCreateCallback = NavigationAction -> IO Widget
- afterWebViewCreate :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewCreateCallback) -> m SignalHandlerId
- onWebViewCreate :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewCreateCallback) -> m SignalHandlerId
- type WebViewDecidePolicyCallback = PolicyDecision -> PolicyDecisionType -> IO Bool
- afterWebViewDecidePolicy :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewDecidePolicyCallback) -> m SignalHandlerId
- onWebViewDecidePolicy :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewDecidePolicyCallback) -> m SignalHandlerId
- type WebViewEnterFullscreenCallback = IO Bool
- afterWebViewEnterFullscreen :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewEnterFullscreenCallback) -> m SignalHandlerId
- onWebViewEnterFullscreen :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewEnterFullscreenCallback) -> m SignalHandlerId
- type WebViewInsecureContentDetectedCallback = InsecureContentEvent -> IO ()
- afterWebViewInsecureContentDetected :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewInsecureContentDetectedCallback) -> m SignalHandlerId
- onWebViewInsecureContentDetected :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewInsecureContentDetectedCallback) -> m SignalHandlerId
- type WebViewLeaveFullscreenCallback = IO Bool
- afterWebViewLeaveFullscreen :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLeaveFullscreenCallback) -> m SignalHandlerId
- onWebViewLeaveFullscreen :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLeaveFullscreenCallback) -> m SignalHandlerId
- type WebViewLoadChangedCallback = LoadEvent -> IO ()
- afterWebViewLoadChanged :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadChangedCallback) -> m SignalHandlerId
- onWebViewLoadChanged :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadChangedCallback) -> m SignalHandlerId
- type WebViewLoadFailedCallback = LoadEvent -> Text -> GError -> IO Bool
- afterWebViewLoadFailed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadFailedCallback) -> m SignalHandlerId
- onWebViewLoadFailed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadFailedCallback) -> m SignalHandlerId
- type WebViewLoadFailedWithTlsErrorsCallback = Text -> TlsCertificate -> [TlsCertificateFlags] -> IO Bool
- afterWebViewLoadFailedWithTlsErrors :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadFailedWithTlsErrorsCallback) -> m SignalHandlerId
- onWebViewLoadFailedWithTlsErrors :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewLoadFailedWithTlsErrorsCallback) -> m SignalHandlerId
- type WebViewMouseTargetChangedCallback = HitTestResult -> Word32 -> IO ()
- afterWebViewMouseTargetChanged :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewMouseTargetChangedCallback) -> m SignalHandlerId
- onWebViewMouseTargetChanged :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewMouseTargetChangedCallback) -> m SignalHandlerId
- type WebViewPermissionRequestCallback = PermissionRequest -> IO Bool
- afterWebViewPermissionRequest :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewPermissionRequestCallback) -> m SignalHandlerId
- onWebViewPermissionRequest :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewPermissionRequestCallback) -> m SignalHandlerId
- type WebViewPrintCallback = PrintOperation -> IO Bool
- afterWebViewPrint :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewPrintCallback) -> m SignalHandlerId
- onWebViewPrint :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewPrintCallback) -> m SignalHandlerId
- type WebViewQueryPermissionStateCallback = PermissionStateQuery -> IO Bool
- afterWebViewQueryPermissionState :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewQueryPermissionStateCallback) -> m SignalHandlerId
- onWebViewQueryPermissionState :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewQueryPermissionStateCallback) -> m SignalHandlerId
- type WebViewReadyToShowCallback = IO ()
- afterWebViewReadyToShow :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewReadyToShowCallback) -> m SignalHandlerId
- onWebViewReadyToShow :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewReadyToShowCallback) -> m SignalHandlerId
- type WebViewResourceLoadStartedCallback = WebResource -> URIRequest -> IO ()
- afterWebViewResourceLoadStarted :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewResourceLoadStartedCallback) -> m SignalHandlerId
- onWebViewResourceLoadStarted :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewResourceLoadStartedCallback) -> m SignalHandlerId
- type WebViewRunAsModalCallback = IO ()
- afterWebViewRunAsModal :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunAsModalCallback) -> m SignalHandlerId
- onWebViewRunAsModal :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunAsModalCallback) -> m SignalHandlerId
- type WebViewRunColorChooserCallback = ColorChooserRequest -> IO Bool
- afterWebViewRunColorChooser :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunColorChooserCallback) -> m SignalHandlerId
- onWebViewRunColorChooser :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunColorChooserCallback) -> m SignalHandlerId
- type WebViewRunFileChooserCallback = FileChooserRequest -> IO Bool
- afterWebViewRunFileChooser :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunFileChooserCallback) -> m SignalHandlerId
- onWebViewRunFileChooser :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewRunFileChooserCallback) -> m SignalHandlerId
- type WebViewScriptDialogCallback = ScriptDialog -> IO Bool
- afterWebViewScriptDialog :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewScriptDialogCallback) -> m SignalHandlerId
- onWebViewScriptDialog :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewScriptDialogCallback) -> m SignalHandlerId
- type WebViewShowNotificationCallback = Notification -> IO Bool
- afterWebViewShowNotification :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewShowNotificationCallback) -> m SignalHandlerId
- onWebViewShowNotification :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewShowNotificationCallback) -> m SignalHandlerId
- type WebViewShowOptionMenuCallback = OptionMenu -> Event -> Rectangle -> IO Bool
- afterWebViewShowOptionMenu :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewShowOptionMenuCallback) -> m SignalHandlerId
- onWebViewShowOptionMenu :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewShowOptionMenuCallback) -> m SignalHandlerId
- type WebViewSubmitFormCallback = FormSubmissionRequest -> IO ()
- afterWebViewSubmitForm :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewSubmitFormCallback) -> m SignalHandlerId
- onWebViewSubmitForm :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewSubmitFormCallback) -> m SignalHandlerId
- type WebViewUserMessageReceivedCallback = UserMessage -> IO Bool
- afterWebViewUserMessageReceived :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewUserMessageReceivedCallback) -> m SignalHandlerId
- onWebViewUserMessageReceived :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewUserMessageReceivedCallback) -> m SignalHandlerId
- type WebViewWebProcessCrashedCallback = IO Bool
- afterWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessCrashedCallback) -> m SignalHandlerId
- onWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessCrashedCallback) -> m SignalHandlerId
- type WebViewWebProcessTerminatedCallback = WebProcessTerminationReason -> IO ()
- afterWebViewWebProcessTerminated :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessTerminatedCallback) -> m SignalHandlerId
- onWebViewWebProcessTerminated :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessTerminatedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
| Eq WebView Source # | |
| GObject WebView Source # | |
Defined in GI.WebKit2.Objects.WebView | |
| ManagedPtrNewtype WebView Source # | |
Defined in GI.WebKit2.Objects.WebView Methods toManagedPtr :: WebView -> ManagedPtr WebView | |
| TypedObject WebView Source # | |
Defined in GI.WebKit2.Objects.WebView | |
| HasParentTypes WebView Source # | |
Defined in GI.WebKit2.Objects.WebView | |
| IsGValue (Maybe WebView) Source # | Convert |
Defined in GI.WebKit2.Objects.WebView Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe WebView -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe WebView) | |
| type ParentTypes WebView Source # | |
Defined in GI.WebKit2.Objects.WebView | |
class (GObject o, IsDescendantOf WebView o) => IsWebView o Source #
Instances
| (GObject o, IsDescendantOf WebView o) => IsWebView o Source # | |
Defined in GI.WebKit2.Objects.WebView | |
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, callAsyncJavascriptFunction, callAsyncJavascriptFunctionFinish, canActivateAccel, canExecuteEditingCommand, canExecuteEditingCommandFinish, canGoBack, canGoForward, canShowMimeType, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, downloadUri, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, evaluateJavascript, evaluateJavascriptFinish, event, executeEditingCommand, executeEditingCommandWithArgument, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, goBack, goForward, goToBackForwardListItem, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isControlledByAutomation, isDrawable, isEditable, isEphemeral, isFloating, isFocus, isLoading, isPlayingAudio, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, loadAlternateHtml, loadBytes, loadHtml, loadPlainText, loadRequest, loadUri, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, reload, reloadBypassCache, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, restoreSessionState, runAsyncJavascriptFunctionInWorld, runDispose, runJavascript, runJavascriptFinish, runJavascriptFromGresource, runJavascriptFromGresourceFinish, runJavascriptInWorld, runJavascriptInWorldFinish, save, saveFinish, saveToFile, saveToFileFinish, sendExpose, sendFocusChange, sendMessageToPage, sendMessageToPageFinish, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, stopLoading, styleAttach, styleGetProperty, terminateWebProcess, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, tryClose, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getAutomationPresentationType, getBackForwardList, getBackgroundColor, getBorderWidth, getCameraCaptureState, getCanDefault, getCanFocus, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getContext, getCustomCharset, getData, getDefaultContentSecurityPolicy, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDisplayCaptureState, getDoubleBuffered, getEditorState, getEstimatedLoadProgress, getEvents, getFavicon, getFindController, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInputMethodContext, getInspector, getInternalChild, getIsMuted, getIsWebProcessResponsive, getMainResource, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMicrophoneCaptureState, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPageId, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSessionState, getSettings, getSizeRequest, getSnapshot, getSnapshotFinish, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTitle, getTlsInfo, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUri, getUserContentManager, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWebExtensionMode, getWebsiteDataManager, getWebsitePolicies, getWindow, getWindowProperties, getZoomLevel.
Setters
setAccelPath, setAllocation, setAppPaintable, setBackgroundColor, setBorderWidth, setBuildableProperty, setCameraCaptureState, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setCorsAllowlist, setCustomCharset, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDisplayCaptureState, setDoubleBuffered, setEditable, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setInputMethodContext, setIsMuted, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setMicrophoneCaptureState, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSettings, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow, setZoomLevel.
callAsyncJavascriptFunction
webViewCallAsyncJavascriptFunction Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Int64 |
|
| -> Maybe GVariant |
|
| -> Maybe Text |
|
| -> Maybe Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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");
}
g_object_unref (value);
}
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 |
|
| -> b |
|
| -> m Value | Returns: a |
Finish an asynchronous operation started with webViewCallAsyncJavascriptFunction.
Since: 2.40
canExecuteEditingCommand
webViewCanExecuteEditingCommand Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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 |
|
| -> b |
|
| -> m () | (Can throw |
Finish an asynchronous operation started with webViewCanExecuteEditingCommand.
canGoBack
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool |
Determines whether webView has a previous history item.
canGoForward
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool |
Determines whether webView has a next history item.
canShowMimeType
webViewCanShowMimeType Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> m Bool | Returns: |
Whether or not a MIME type can be displayed in webView.
downloadUri
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> m Download | Returns: a new |
Requests downloading of the specified URI string for webView.
evaluateJavascript
webViewEvaluateJavascript Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Int64 |
|
| -> Maybe Text |
|
| -> Maybe Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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");
}
g_object_unref (value);
}
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 |
|
| -> b |
|
| -> m Value | Returns: a |
Finish an asynchronous operation started with webViewEvaluateJavascript.
Since: 2.40
executeEditingCommand
webViewExecuteEditingCommand Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> 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 |
|
| -> Text |
|
| -> Text |
|
| -> 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 #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m AutomationBrowsingContextPresentation | Returns: a |
Get the presentation type of WebView when created for automation.
Since: 2.28
getBackForwardList
webViewGetBackForwardList Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m BackForwardList | Returns: the |
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 |
|
| -> 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 |
|
| -> m MediaCaptureState | Returns: The |
Get the camera capture state of a WebView.
Since: 2.34
getContext
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebContext | Returns: the |
Gets the web context of webView.
getCustomCharset
webViewGetCustomCharset Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe Text) | Returns: the current custom character encoding name or |
Returns the current custom character encoding name of webView.
getDefaultContentSecurityPolicy
webViewGetDefaultContentSecurityPolicy Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe Text) | Returns: The default policy or |
Gets the configured default Content-Security-Policy.
Since: 2.38
getDisplayCaptureState
webViewGetDisplayCaptureState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m MediaCaptureState | Returns: The |
Get the display capture state of a WebView.
Since: 2.34
getEditorState
webViewGetEditorState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m EditorState | Returns: the |
Gets the web editor state of webView.
Since: 2.10
getEstimatedLoadProgress
webViewGetEstimatedLoadProgress Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe Surface) | Returns: the favicon image or |
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 |
|
| -> m FindController | Returns: the |
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 |
|
| -> m (Maybe InputMethodContext) | Returns: a |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebInspector | Returns: the |
Get the WebInspector associated to webView
getIsMuted
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool | Returns: |
Gets the mute state of webView.
Since: 2.30
getIsWebProcessResponsive
webViewGetIsWebProcessResponsive Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool | Returns: |
Get whether the current web process of a WebView is responsive.
Since: 2.34
getMainResource
webViewGetMainResource Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe WebResource) | Returns: the main |
Return the main resource of webView.
getMicrophoneCaptureState
webViewGetMicrophoneCaptureState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m MediaCaptureState | Returns: The |
Get the microphone capture state of a WebView.
Since: 2.34
getPageId
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Word64 | Returns: the page ID of |
Get the identifier of the WebKitWebPage corresponding to
the WebView
getSessionState
webViewGetSessionState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebViewSessionState | Returns: a |
Gets the current session state of webView
Since: 2.12
getSettings
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Settings | Returns: the |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> SnapshotRegion |
|
| -> [SnapshotOptions] |
|
| -> Maybe b |
|
| -> Maybe 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 |
|
| -> b |
|
| -> m Surface | Returns: an image with the retrieved snapshot, or |
Finishes an asynchronous operation started with webViewGetSnapshot.
getTitle
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe Text) | Returns: The main frame document title of |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Bool, TlsCertificate, [TlsCertificateFlags]) | Returns: |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m (Maybe Text) | Returns: the current active URI of |
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 |
|
| -> m UserContentManager | Returns: the |
Gets the user content manager associated to webView.
Since: 2.6
getWebExtensionMode
webViewGetWebExtensionMode Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebExtensionMode | Returns: the |
Get the view's WebExtensionMode.
Since: 2.38
getWebsiteDataManager
webViewGetWebsiteDataManager Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebsiteDataManager | Returns: a |
Get the WebsiteDataManager associated to webView.
If webView is not ephemeral,
the returned WebsiteDataManager will be the same as the WebsiteDataManager
of webView's WebContext.
Since: 2.16
getWebsitePolicies
webViewGetWebsitePolicies Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebsitePolicies | Returns: the default |
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 |
|
| -> m WindowProperties | Returns: the |
Get the WindowProperties object.
Get the WindowProperties object containing the properties
that the window containing webView should have.
getZoomLevel
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Double | Returns: the current zoom level of |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m () |
Loads the previous history item.
You can monitor the load operation by connecting to WebView::loadChanged signal.
goForward
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> 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 |
|
| -> b |
|
| -> 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 |
|
| -> m Bool | Returns: |
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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool | Returns: |
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
isEphemeral
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool |
Get whether a WebView is ephemeral.
To create an ephemeral WebView you need to
use g_object_new() and pass is-ephemeral property with True value. See
WebView:isEphemeral for more details.
If webView was created with a ephemeral WebView:relatedView or an
ephemeral WebView:webContext it will also be ephemeral.
Since: 2.16
isLoading
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m Bool | Returns: |
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 |
|
| -> m Bool | Returns: |
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 |
|
| -> Text |
|
| -> Text |
|
| -> Maybe Text |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Bytes |
|
| -> Maybe Text |
|
| -> Maybe Text |
|
| -> Maybe Text |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> Maybe Text |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsURIRequest b) | |
| => a |
|
| -> b |
|
| -> m () |
Requests loading of the specified URIRequest.
You can monitor the load operation by connecting to WebView::loadChanged signal.
loadUri
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Text |
|
| -> m () |
Requests loading of the specified URI string.
You can monitor the load operation by connecting to WebView::loadChanged signal.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m WebView | Returns: The newly created |
Creates a new WebView with the default WebContext.
Creates a new WebView with the default WebContext and
no UserContentManager associated with it.
See also webViewNewWithContext,
webViewNewWithUserContentManager, and
webViewNewWithSettings.
newWithContext
webViewNewWithContext Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebContext a) | |
| => a |
|
| -> m WebView | Returns: The newly created |
Creates a new WebView with the given WebContext.
Creates a new WebView with the given WebContext and
no UserContentManager associated with it.
See also webViewNewWithUserContentManager and
webViewNewWithSettings.
newWithRelatedView
webViewNewWithRelatedView Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m WebView | Returns: The newly created |
Creates a new WebView sharing the same web process with webView.
This method doesn't have any effect when ProcessModelSharedSecondaryProcess
process model is used, because a single web process is shared for all the web views in the
same WebContext. When using ProcessModelMultipleSecondaryProcesses process model,
this method should always be used when creating the WebView in the WebView::create signal.
You can also use this method to implement other process models based on ProcessModelMultipleSecondaryProcesses,
like for example, sharing the same web process for all the views in the same security domain.
The newly created WebView will also have the same UserContentManager,
Settings, and WebsitePolicies as webView.
Since: 2.4
newWithSettings
webViewNewWithSettings Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSettings a) | |
| => a |
|
| -> m WebView | Returns: The newly created |
Creates a new WebView with the given Settings.
See also webViewNewWithContext, and
webViewNewWithUserContentManager.
Since: 2.6
newWithUserContentManager
webViewNewWithUserContentManager Source #
Arguments
| :: (HasCallStack, MonadIO m, IsUserContentManager a) | |
| => a |
|
| -> m WebView | Returns: The newly created |
Creates a new WebView with the given UserContentManager.
The content loaded in the view may be affected by the content injected in the view by the user content manager.
Since: 2.6
reload
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m () |
Reloads the current contents of webView.
See also webViewReloadBypassCache.
reloadBypassCache
webViewReloadBypassCache Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> m () |
Reloads the current contents of webView without
using any cached data.
restoreSessionState
webViewRestoreSessionState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> WebViewSessionState |
|
| -> m () |
Restore the webView session state from state
Since: 2.12
runAsyncJavascriptFunctionInWorld
webViewRunAsyncJavascriptFunctionInWorld Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> GVariant |
|
| -> Maybe Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Deprecated: (Since version 2.40)Use webViewCallAsyncJavascriptFunction instead.
Asynchronously run body in the script world with name worldName of the current page context in
webView. If WebKitSettings:enable-javascript is FALSE, this method will do nothing. This API
differs from webViewRunJavascriptInWorld in that the JavaScript function can return a
Promise and its result will be properly passed to the callback.
When the operation is finished, callback will be called. You can then call
webViewRunJavascriptInWorldFinish to get the result of the operation.
For instance here is a dummy 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)
{
WebKitJavascriptResult *js_result;
JSCValue *value;
GError *error = NULL;
js_result = webkit_web_view_run_javascript_finish (WEBKIT_WEB_VIEW (object), result, &error);
if (!js_result) {
g_warning ("Error running javascript: %s", error->message);
g_error_free (error);
return;
}
value = webkit_javascript_result_get_js_value (js_result);
if (jsc_value_is_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_run_async_javascript_function_in_world (web_view, body, arguments, NULL, NULL, web_view_javascript_finished, NULL);
}Since: 2.38
runJavascript
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Deprecated: (Since version 2.40)Use webViewEvaluateJavascript instead.
Asynchronously run script in the context of the current page in webView.
If WebKitSettings:enable-javascript is FALSE, this method will do nothing.
When the operation is finished, callback will be called. You can then call
webViewRunJavascriptFinish to get the result of the operation.
runJavascriptFinish
webViewRunJavascriptFinish Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m JavascriptResult | Returns: a |
Deprecated: (Since version 2.40)Use webViewEvaluateJavascriptFinish instead.
Finish an asynchronous operation started with webViewRunJavascript.
This is an example of using webViewRunJavascript with a script returning
a string:
c code
static void
web_view_javascript_finished (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
WebKitJavascriptResult *js_result;
JSCValue *value;
GError *error = NULL;
js_result = webkit_web_view_run_javascript_finish (WEBKIT_WEB_VIEW (object), result, &error);
if (!js_result) {
g_warning ("Error running javascript: %s", error->message);
g_error_free (error);
return;
}
value = webkit_javascript_result_get_js_value (js_result);
if (jsc_value_is_string (value)) {
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_run_javascript (web_view, script, NULL, web_view_javascript_finished, NULL);
g_free (script);
}runJavascriptFromGresource
webViewRunJavascriptFromGresource Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Deprecated: (Since version 2.40)Use webViewEvaluateJavascript instead.
Asynchronously run the script from resource.
Asynchronously run the script from resource in the context of the
current page in webView.
When the operation is finished, callback will be called. You can
then call webViewRunJavascriptFromGresourceFinish to get the result
of the operation.
runJavascriptFromGresourceFinish
webViewRunJavascriptFromGresourceFinish Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m JavascriptResult | Returns: a |
Deprecated: (Since version 2.40)Use webViewEvaluateJavascriptFinish instead.
Finish an asynchronous operation started with webViewRunJavascriptFromGresource.
Check webViewRunJavascriptFinish for a usage example.
runJavascriptInWorld
webViewRunJavascriptInWorld Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Text |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Deprecated: (Since version 2.40)Use webViewEvaluateJavascript instead.
Asynchronously run script in the script world.
Asynchronously run script in the script world with name worldName of the current page context in webView.
If WebKitSettings:enable-javascript is FALSE, this method will do nothing.
When the operation is finished, callback will be called. You can then call
webViewRunJavascriptInWorldFinish to get the result of the operation.
Since: 2.22
runJavascriptInWorldFinish
webViewRunJavascriptInWorldFinish Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m JavascriptResult | Returns: a |
Deprecated: (Since version 2.40)Use webViewCallAsyncJavascriptFunctionFinish instead.
Finish an asynchronous operation started with webViewRunJavascriptInWorld.
Since: 2.22
save
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsCancellable b) | |
| => a |
|
| -> SaveMode |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m InputStream | Returns: a |
Finish an asynchronous operation started with webViewSave.
saveToFile
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsFile b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> SaveMode |
|
| -> Maybe c |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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 |
|
| -> b |
|
| -> m () | (Can throw |
Finish an asynchronous operation started with webViewSaveToFile.
sendMessageToPage
webViewSendMessageToPage Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsUserMessage b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> Maybe c |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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 |
|
| -> b |
|
| -> m UserMessage | Returns: a |
Finish an asynchronous operation started with webViewSendMessageToPage.
Since: 2.28
setBackgroundColor
webViewSetBackgroundColor Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => 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:appPaintable 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 |
|
| -> 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 |
|
| -> Maybe [Text] |
|
| -> 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 |
|
| -> Maybe Text |
|
| -> 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 |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Bool |
|
| -> 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 |
|
| -> Maybe b |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Sets the mute state of webView.
Since: 2.30
setMicrophoneCaptureState
webViewSetMicrophoneCaptureState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a, IsSettings b) | |
| => a |
|
| -> b |
|
| -> m () |
setZoomLevel
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> Double |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> 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 |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsWebView a) | |
| => a |
|
| -> 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
setwebView [ #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
webViewRunJavascript.
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
setwebView [ #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
setwebView [ #editable:=value ]
estimatedLoadProgress
An estimate of the percent completion for the current loading operation. This value will range from 0.0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0.0. The value is an estimate based on the total number of bytes expected to be received for a document, including all its possible subresources and child documents.
getWebViewEstimatedLoadProgress :: (MonadIO m, IsWebView o) => o -> m Double Source #
Get the value of the “estimated-load-progress” property.
When overloading is enabled, this is equivalent to
get webView #estimatedLoadProgress
favicon
The favicon currently associated to the WebView.
See webViewGetFavicon for more details.
getWebViewFavicon :: (MonadIO m, IsWebView o) => o -> m (Ptr ()) Source #
Get the value of the “favicon” property.
When overloading is enabled, this is equivalent to
get webView #favicon
isControlledByAutomation
Whether the WebView is controlled by automation. This should only be used when
creating a new WebView as a response to AutomationSession::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
isEphemeral
Whether the WebView is ephemeral. An ephemeral web view never writes
website data to the client storage, no matter what WebsiteDataManager
its context is using. This is normally used to implement private browsing mode.
This is a ParamFlagsConstructOnly property, so you have to create an ephemeral
WebView and it can't be changed. The ephemeral WebsiteDataManager
created for the WebView will inherit the network settings from the
WebContext's WebsiteDataManager. To use different settings
you can get the WebsiteDataManager with webViewGetWebsiteDataManager
and set the new ones.
Note that all WebViews created with an ephemeral WebContext
will be ephemeral automatically.
See also webContextNewEphemeral.
Since: 2.16
constructWebViewIsEphemeral :: (IsWebView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “is-ephemeral” property. This is rarely needed directly, but it is used by new.
getWebViewIsEphemeral :: (MonadIO m, IsWebView o) => o -> m Bool Source #
Get the value of the “is-ephemeral” property.
When overloading is enabled, this is equivalent to
get webView #isEphemeral
isLoading
Whether the WebView is currently loading a page. This property becomes
True as soon as a new load operation is requested and before the
WebView::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
setwebView [ #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
setwebView [ #microphoneCaptureState:=value ]
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
setwebView [ #settings:=value ]
title
The main frame document title of this WebView. If
the title has not been received yet, it will be Nothing.
getWebViewTitle :: (MonadIO m, IsWebView o) => o -> m (Maybe Text) Source #
Get the value of the “title” property.
When overloading is enabled, this is equivalent to
get webView #title
uri
The current active URI of the WebView.
See webViewGetUri for more details.
getWebViewUri :: (MonadIO m, IsWebView o) => o -> m (Maybe Text) Source #
Get the value of the “uri” property.
When overloading is enabled, this is equivalent to
get webView #uri
userContentManager
The UserContentManager of the view.
Since: 2.6
constructWebViewUserContentManager :: (IsWebView o, 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
setwebView [ #zoomLevel:=value ]
Signals
authenticate
type WebViewAuthenticateCallback Source #
Arguments
| = AuthenticationRequest |
|
| -> IO Bool | Returns: |
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 |
|
| -> Event |
|
| -> HitTestResult |
|
| -> IO Bool | Returns: |
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 Menu and return True to prevent the proposed menu from being shown.
</para></listitem>
<listitem><para>
If you just want the default menu to be shown always, simply don't connect to this
signal because showing the proposed context menu is the default behaviour.
</para></listitem>
</itemizedlist>
The event parameter is now deprecated. Use contextMenuGetEvent to get the
Event that triggered the context menu.
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 |
|
| -> IO Widget | Returns: a newly allocated |
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 |
|
| -> PolicyDecisionType |
|
| -> IO Bool | Returns: |
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: |
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 |
|
| -> 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: |
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 #
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 |
|
| -> Text |
|
| -> GError |
|
| -> IO Bool | Returns: |
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 |
|
| -> TlsCertificate |
|
| -> [TlsCertificateFlags] |
|
| -> IO Bool | Returns: |
Emitted when a TLS error occurs during a load operation.
To allow an exception for this certificate
and the host of failingUri use webContextAllowTlsCertificateForHost.
To handle this signal asynchronously you should call objectRef on certificate
and return True.
If False is returned, WebView::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 |
|
| -> Word32 |
|
| -> 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 |
|
| -> IO Bool | Returns: |
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
type WebViewPrintCallback Source #
Arguments
| = PrintOperation |
|
| -> IO Bool | Returns: |
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 |
|
| -> IO Bool | Returns: |
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 |
|
| -> 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 |
|
| -> IO Bool | Returns: |
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 |
|
| -> IO Bool | Returns: |
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 |
|
| -> IO Bool | Returns: |
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 |
|
| -> IO Bool | Returns: |
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 |
|
| -> Event |
|
| -> Rectangle |
|
| -> IO Bool | Returns: |
This signal is emitted when a select element in webView needs to display a
dropdown menu. This signal can be used to show a custom menu, using menu to get
the details of all items that should be displayed. The area of the element in the
WebView is given as rectangle parameter, it can be used to position the
menu. If this was triggered by a user interaction, like a mouse click,
event parameter provides the Event.
To handle this signal asynchronously you should keep a ref of the menu.
The event parameter is now deprecated. Use optionMenuGetEvent to get the
Event that triggered the dropdown menu.
The default signal handler will pop up a Menu.
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 |
|
| -> 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 |
|
| -> IO Bool | Returns: |
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
webProcessCrashed
type WebViewWebProcessCrashedCallback Source #
Arguments
| = IO Bool | Returns: |
Deprecated: (Since version 2.20)Use WebKitWebViewwebProcessTerminated instead.
This signal is emitted when the web process crashes.
afterWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessCrashedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the webProcessCrashed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after webView #webProcessCrashed 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.
onWebViewWebProcessCrashed :: (IsWebView a, MonadIO m) => a -> ((?self :: a) => WebViewWebProcessCrashedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the webProcessCrashed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on webView #webProcessCrashed callback
webProcessTerminated
type WebViewWebProcessTerminatedCallback Source #
Arguments
| = WebProcessTerminationReason |
|
| -> IO () |
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