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 |
A loaded web page.
Synopsis
- newtype WebPage = WebPage (ManagedPtr WebPage)
- class (GObject o, IsDescendantOf WebPage o) => IsWebPage o
- toWebPage :: (MonadIO m, IsWebPage o) => o -> m WebPage
- webPageGetDomDocument :: (HasCallStack, MonadIO m, IsWebPage a) => a -> m (Maybe DOMDocument)
- webPageGetEditor :: (HasCallStack, MonadIO m, IsWebPage a) => a -> m WebEditor
- webPageGetId :: (HasCallStack, MonadIO m, IsWebPage a) => a -> m Word64
- webPageGetMainFrame :: (HasCallStack, MonadIO m, IsWebPage a) => a -> m Frame
- webPageGetUri :: (HasCallStack, MonadIO m, IsWebPage a) => a -> m (Maybe Text)
- webPageSendMessageToView :: (HasCallStack, MonadIO m, IsWebPage a, IsUserMessage b, IsCancellable c) => a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- webPageSendMessageToViewFinish :: (HasCallStack, MonadIO m, IsWebPage a, IsAsyncResult b) => a -> b -> m UserMessage
- getWebPageUri :: (MonadIO m, IsWebPage o) => o -> m (Maybe Text)
- type WebPageConsoleMessageSentCallback = ConsoleMessage -> IO ()
- afterWebPageConsoleMessageSent :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageConsoleMessageSentCallback) -> m SignalHandlerId
- onWebPageConsoleMessageSent :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageConsoleMessageSentCallback) -> m SignalHandlerId
- type WebPageContextMenuCallback = ContextMenu -> WebHitTestResult -> IO Bool
- afterWebPageContextMenu :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageContextMenuCallback) -> m SignalHandlerId
- onWebPageContextMenu :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageContextMenuCallback) -> m SignalHandlerId
- type WebPageDocumentLoadedCallback = IO ()
- afterWebPageDocumentLoaded :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageDocumentLoadedCallback) -> m SignalHandlerId
- onWebPageDocumentLoaded :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageDocumentLoadedCallback) -> m SignalHandlerId
- type WebPageFormControlsAssociatedCallback = [DOMElement] -> IO ()
- afterWebPageFormControlsAssociated :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedCallback) -> m SignalHandlerId
- onWebPageFormControlsAssociated :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedCallback) -> m SignalHandlerId
- type WebPageFormControlsAssociatedForFrameCallback = [DOMElement] -> Frame -> IO ()
- afterWebPageFormControlsAssociatedForFrame :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedForFrameCallback) -> m SignalHandlerId
- onWebPageFormControlsAssociatedForFrame :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedForFrameCallback) -> m SignalHandlerId
- type WebPageSendRequestCallback = URIRequest -> URIResponse -> IO Bool
- afterWebPageSendRequest :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageSendRequestCallback) -> m SignalHandlerId
- onWebPageSendRequest :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageSendRequestCallback) -> m SignalHandlerId
- type WebPageUserMessageReceivedCallback = UserMessage -> IO Bool
- afterWebPageUserMessageReceived :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageUserMessageReceivedCallback) -> m SignalHandlerId
- onWebPageUserMessageReceived :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageUserMessageReceivedCallback) -> m SignalHandlerId
- type WebPageWillSubmitFormCallback = DOMElement -> FormSubmissionStep -> Frame -> Frame -> [Text] -> [Text] -> IO ()
- afterWebPageWillSubmitForm :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageWillSubmitFormCallback) -> m SignalHandlerId
- onWebPageWillSubmitForm :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageWillSubmitFormCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq WebPage Source # | |
GObject WebPage Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage | |
ManagedPtrNewtype WebPage Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage toManagedPtr :: WebPage -> ManagedPtr WebPage | |
TypedObject WebPage Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage | |
HasParentTypes WebPage Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage | |
IsGValue (Maybe WebPage) Source # | Convert |
Defined in GI.WebKit2WebExtension.Objects.WebPage gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe WebPage -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe WebPage) | |
type ParentTypes WebPage Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage type ParentTypes WebPage = '[Object] |
class (GObject o, IsDescendantOf WebPage o) => IsWebPage o Source #
Instances
(GObject o, IsDescendantOf WebPage o) => IsWebPage o Source # | |
Defined in GI.WebKit2WebExtension.Objects.WebPage |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, sendMessageToView, sendMessageToViewFinish, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getDomDocument, getEditor, getId, getMainFrame, getProperty, getQdata, getUri.
Setters
getDomDocument
webPageGetDomDocument Source #
:: (HasCallStack, MonadIO m, IsWebPage a) | |
=> a |
|
-> m (Maybe DOMDocument) | Returns: the |
Get the DOMDocument
currently loaded in webPage
getEditor
getId
:: (HasCallStack, MonadIO m, IsWebPage a) | |
=> a |
|
-> m Word64 | Returns: the identifier of |
Get the identifier of the WebPage
getMainFrame
:: (HasCallStack, MonadIO m, IsWebPage a) | |
=> a |
|
-> m Frame | Returns: the |
Returns the main frame of a WebPage
.
Since: 2.2
getUri
:: (HasCallStack, MonadIO m, IsWebPage a) | |
=> a |
|
-> m (Maybe Text) | Returns: the current active URI of |
Returns the current active URI of webPage
.
You can monitor the active URI by connecting to the notifyuri
signal of webPage
.
sendMessageToView
webPageSendMessageToView Source #
:: (HasCallStack, MonadIO m, IsWebPage a, IsUserMessage b, IsCancellable c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Send message
to the WebKitWebView
corresponding to webPage
. 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
webPageSendMessageToViewFinish
to get the message reply.
Since: 2.28
sendMessageToViewFinish
webPageSendMessageToViewFinish Source #
:: (HasCallStack, MonadIO m, IsWebPage a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m UserMessage | Returns: a |
Finish an asynchronous operation started with webPageSendMessageToView
.
Since: 2.28
Properties
uri
The current active URI of the WebPage
.
getWebPageUri :: (MonadIO m, IsWebPage o) => o -> m (Maybe Text) Source #
Get the value of the “uri
” property.
When overloading is enabled, this is equivalent to
get
webPage #uri
Signals
consoleMessageSent
type WebPageConsoleMessageSentCallback Source #
= ConsoleMessage |
|
-> IO () |
Emitted when a message is sent to the console. This can be a message
produced by the use of JavaScript console API, a JavaScript exception,
a security error or other errors, warnings, debug or log messages.
The consoleMessage
contains information of the message.
Since: 2.12
afterWebPageConsoleMessageSent :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageConsoleMessageSentCallback) -> m SignalHandlerId Source #
Connect a signal handler for the consoleMessageSent signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #consoleMessageSent 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.
onWebPageConsoleMessageSent :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageConsoleMessageSentCallback) -> m SignalHandlerId Source #
Connect a signal handler for the consoleMessageSent signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #consoleMessageSent callback
contextMenu
type WebPageContextMenuCallback Source #
= ContextMenu |
|
-> WebHitTestResult |
|
-> IO Bool | Returns: |
Emitted before a context menu is displayed in the UI Process to
give the application a chance to customize the proposed menu,
build its own context menu or pass user data to the UI Process.
This signal is useful when the information available in the UI Process
is not enough to build or customize the context menu, for example, to
add menu entries depending on the DOMNode
at the coordinates of the
hitTestResult
. Otherwise, it's recommended to use WebKitWebView::context-menu
signal instead.
Since: 2.8
afterWebPageContextMenu :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageContextMenuCallback) -> 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
webPage #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.
onWebPageContextMenu :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageContextMenuCallback) -> 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
webPage #contextMenu callback
documentLoaded
type WebPageDocumentLoadedCallback = IO () Source #
This signal is emitted when the DOM document of a WebPage
has been
loaded.
You can wait for this signal to get the DOM document with
webPageGetDomDocument
.
afterWebPageDocumentLoaded :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageDocumentLoadedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the documentLoaded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #documentLoaded 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.
onWebPageDocumentLoaded :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageDocumentLoadedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the documentLoaded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #documentLoaded callback
formControlsAssociated
type WebPageFormControlsAssociatedCallback Source #
= [DOMElement] |
|
-> IO () |
Deprecated: (Since version 2.26), use WebPage::formControlsAssociatedForFrame instead.
Emitted after form elements (or form associated elements) are associated to a particular web page. This is useful to implement form auto filling for web pages where form fields are added dynamically. This signal might be emitted multiple times for the same web page.
Note that this signal could be also emitted when form controls are moved between forms. In
that case, the elements
array carries the list of those elements which have moved.
Clients should take a reference to the members of the elements
array if it is desired to
keep them alive after the signal handler returns.
Since: 2.16
afterWebPageFormControlsAssociated :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the formControlsAssociated signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #formControlsAssociated 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.
onWebPageFormControlsAssociated :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the formControlsAssociated signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #formControlsAssociated callback
formControlsAssociatedForFrame
type WebPageFormControlsAssociatedForFrameCallback Source #
= [DOMElement] |
|
-> Frame |
|
-> IO () |
Emitted after form elements (or form associated elements) are associated to a particular web page. This is useful to implement form auto filling for web pages where form fields are added dynamically. This signal might be emitted multiple times for the same web page.
Note that this signal could be also emitted when form controls are moved between forms. In
that case, the elements
array carries the list of those elements which have moved.
Clients should take a reference to the members of the elements
array if it is desired to
keep them alive after the signal handler returns.
Since: 2.26
afterWebPageFormControlsAssociatedForFrame :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedForFrameCallback) -> m SignalHandlerId Source #
Connect a signal handler for the formControlsAssociatedForFrame signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #formControlsAssociatedForFrame 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.
onWebPageFormControlsAssociatedForFrame :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageFormControlsAssociatedForFrameCallback) -> m SignalHandlerId Source #
Connect a signal handler for the formControlsAssociatedForFrame signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #formControlsAssociatedForFrame callback
sendRequest
type WebPageSendRequestCallback Source #
= URIRequest |
|
-> URIResponse |
|
-> IO Bool | Returns: |
This signal is emitted when request
is about to be sent to
the server. This signal can be used to modify the URIRequest
that will be sent to the server. You can also cancel the resource load
operation by connecting to this signal and returning True
.
In case of a server redirection this signal is
emitted again with the request
argument containing the new
request to be sent to the server due to the redirection and the
redirectedResponse
parameter containing the response
received by the server for the initial request.
Modifications to the URIRequest
and its associated
MessageHeaders
will be taken into account when the request
is sent over the network.
afterWebPageSendRequest :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageSendRequestCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sendRequest signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #sendRequest 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.
onWebPageSendRequest :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageSendRequestCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sendRequest signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #sendRequest callback
userMessageReceived
type WebPageUserMessageReceivedCallback Source #
= UserMessage |
|
-> IO Bool | Returns: |
This signal is emitted when a UserMessage
is received from the
WebKitWebView
corresponding to webPage
. 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 been replied, the operation in the WebKitWebView
will
finish with error UserMessageErrorUserMessageUnhandledMessage
.
Since: 2.28
afterWebPageUserMessageReceived :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageUserMessageReceivedCallback) -> 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
webPage #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.
onWebPageUserMessageReceived :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageUserMessageReceivedCallback) -> 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
webPage #userMessageReceived callback
willSubmitForm
type WebPageWillSubmitFormCallback Source #
= DOMElement |
|
-> FormSubmissionStep |
|
-> Frame |
|
-> Frame |
|
-> [Text] |
|
-> [Text] |
|
-> IO () |
This signal is emitted to indicate various points during form
submission. step
indicates the current stage of form submission.
If this signal is emitted with FormSubmissionStepSendDomEvent
,
then the DOM submit event is about to be emitted. JavaScript code
may rely on the submit event to detect that the user has clicked
on a submit button, and to possibly cancel the form submission
before FormSubmissionStepComplete
. However, beware
that, for historical reasons, the submit event is not emitted at
all if the form submission is triggered by JavaScript. For these
reasons, FormSubmissionStepSendDomEvent
may not
be used to reliably detect whether a form will be submitted.
Instead, use it to detect if a user has clicked on a form's
submit button even if JavaScript later cancels the form
submission, or to read the values of the form's fields even if
JavaScript later clears certain fields before submitting. This
may be needed, for example, to implement a robust browser
password manager, as some misguided websites may use such
techniques to attempt to thwart password managers.
If this signal is emitted with FormSubmissionStepComplete
,
the form will imminently be submitted. It can no longer be
cancelled. This event always occurs immediately before a form is
submitted to its target, so use this event to reliably detect
when a form is submitted. This event occurs after
FormSubmissionStepSendDomEvent
if that event is
emitted.
Since: 2.20
afterWebPageWillSubmitForm :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageWillSubmitFormCallback) -> m SignalHandlerId Source #
Connect a signal handler for the willSubmitForm signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webPage #willSubmitForm 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.
onWebPageWillSubmitForm :: (IsWebPage a, MonadIO m) => a -> ((?self :: a) => WebPageWillSubmitFormCallback) -> m SignalHandlerId Source #
Connect a signal handler for the willSubmitForm signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webPage #willSubmitForm callback