Class WebPage.Builder<B extends WebPage.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
WebPage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theWebPage
object.Emitted when a message is sent to the console.onContextMenu
(WebPage.ContextMenuCallback handler) 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 emitted when the DOM document of aWebKitWebPage
has been loaded.onSendRequest
(WebPage.SendRequestCallback handler) This signal is emitted whenrequest
is about to be sent to the server.This signal is emitted when aWebKitUserMessage
is received from theWebKitWebView
corresponding towebPage
.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theWebPage
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toWebPage
.- Overrides:
build
in classGObject.Builder<B extends WebPage.Builder<B>>
- Returns:
- a new instance of
WebPage
with the properties that were set in the Builder object. - Throws:
UnsupportedPlatformException
- when run on an unsupported platform
-
onConsoleMessageSent
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. TheconsoleMessage
contains information of the message.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onContextMenu
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 node at the coordinates of thehitTestResult
. Otherwise, it's recommended to useWebKitWebView
::context-menu signal instead.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onDocumentLoaded
This signal is emitted when the DOM document of aWebKitWebPage
has been loaded.You can wait for this signal to get the DOM document
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSendRequest
This signal is emitted whenrequest
is about to be sent to the server. This signal can be used to modify theWebKitURIRequest
that will be sent to the server. You can also cancel the resource load operation by connecting to this signal and returningtrue
.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 theredirectedResponse
parameter containing the response received by the server for the initial request.Modifications to the
WebKitURIRequest
and its associatedSoupMessageHeaders
will be taken into account when the request is sent over the network.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onUserMessageReceived
This signal is emitted when aWebKitUserMessage
is received from theWebKitWebView
corresponding towebPage
. You can reply to the message using webkit_user_message_send_reply().You can handle the user message asynchronously by calling g_object_ref() on
message
and returningtrue
. If the last reference ofmessage
is removed and the message has been replied, the operation in theWebKitWebView
will finish with errorUserMessageError.USER_MESSAGE_UNHANDLED_MESSAGE
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-