Class WebPage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWebPage.Builder<B extends WebPage.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theConsoleMessageSentCallbackcallback.static interfaceFunctional interface declaration of theContextMenuCallbackcallback.static interfaceFunctional interface declaration of theDocumentLoadedCallbackcallback.static interfaceFunctional interface declaration of theSendRequestCallbackcallback.static interfaceFunctional interface declaration of theUserMessageReceivedCallbackcallback.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionWebPage()Creates a new WebPage.WebPage(MemorySegment address) Create a WebPage proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebPageasParent()Returns this instance as if it were its parent type.static WebPage.Builder<? extends WebPage.Builder> builder()AWebPage.Builderobject constructs aWebPagewith the specified properties.voidemitConsoleMessageSent(@Nullable ConsoleMessage consoleMessage) Emits the "console-message-sent" signal.booleanemitContextMenu(@Nullable ContextMenu contextMenu, @Nullable WebHitTestResult hitTestResult) Emits the "context-menu" signal.voidEmits the "document-loaded" signal.booleanemitSendRequest(@Nullable URIRequest request, @Nullable URIResponse redirectedResponse) Emits the "send-request" signal.booleanemitUserMessageReceived(@Nullable UserMessage message) Emits the "user-message-received" signal.Gets theWebKitWebEditorof aWebKitWebPage.getFormManager(@Nullable ScriptWorld world) Get theWebKitWebFormManagerof this WebPage inworld.longgetId()Get the identifier of theWebKitWebPageDeprecated.static @Nullable TypegetType()Get the GType of the WebPage classgetUri()Returns the current active URI ofwebPage.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 aWebKitWebPagehas been loaded.onSendRequest(WebPage.SendRequestCallback handler) This signal is emitted whenrequestis about to be sent to the server.This signal is emitted when aWebKitUserMessageis received from theWebKitWebViewcorresponding towebPage.You can reply to the message using webkit_user_message_send_reply().voidsendMessageToView(UserMessage message, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Sendmessageto theWebKitWebViewcorresponding towebPage.Ifmessageis floating, it's consumed.sendMessageToViewFinish(AsyncResult result) Finish an asynchronous operation started with webkit_web_page_send_message_to_view().Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
WebPage
Create a WebPage proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
WebPage
public WebPage()Creates a new WebPage.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getEditor
Gets theWebKitWebEditorof aWebKitWebPage.- Returns:
- the
WebKitWebEditor - Since:
- 2.10
-
getFormManager
Get theWebKitWebFormManagerof this WebPage inworld.- Parameters:
world- aWebKitScriptWorld- Returns:
- a
WebKitWebFormManager - Since:
- 2.40
-
getId
public long getId()Get the identifier of theWebKitWebPage- Returns:
- the identifier of this WebPage
-
getMainFrame
Deprecated.Returns the main frame of aWebKitWebPage.- Returns:
- the
WebKitFramethat is the main frame of this WebPage - Since:
- 2.2
-
getUri
Returns the current active URI ofwebPage.You can monitor the active URI by connecting to the notify::uri signal of
webPage.- Returns:
- the current active URI of
webViewornullif nothing has been loaded yet.
-
sendMessageToView
public void sendMessageToView(UserMessage message, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Sendmessageto theWebKitWebViewcorresponding towebPage.Ifmessageis floating, it's consumed.If you don't expect any reply, or you simply want to ignore it, you can pass
nullascallback.When the operation is finished,callbackwill be called. You can then call webkit_web_page_send_message_to_view_finish() to get the message reply.- Parameters:
message- aWebKitUserMessagecancellable- aGCancellableornullto ignorecallback- AGAsyncReadyCallbackto call when the request is satisfied ornull- Since:
- 2.28
-
sendMessageToViewFinish
Finish an asynchronous operation started with webkit_web_page_send_message_to_view().- Parameters:
result- aGAsyncResult- Returns:
- a
WebKitUserMessagewith the reply ornullin case of error. - Throws:
GErrorException- seeGError- Since:
- 2.28
-
onConsoleMessageSent
public SignalConnection<WebPage.ConsoleMessageSentCallback> onConsoleMessageSent(WebPage.ConsoleMessageSentCallback handler) 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. TheconsoleMessagecontains information of the message.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.12
- See Also:
-
emitConsoleMessageSent
Emits the "console-message-sent" signal. SeeonConsoleMessageSent(org.webkitgtk.webprocessextension.WebPage.ConsoleMessageSentCallback). -
onContextMenu
public SignalConnection<WebPage.ContextMenuCallback> 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 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:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.8
- See Also:
-
emitContextMenu
public boolean emitContextMenu(@Nullable ContextMenu contextMenu, @Nullable WebHitTestResult hitTestResult) Emits the "context-menu" signal. SeeonContextMenu(org.webkitgtk.webprocessextension.WebPage.ContextMenuCallback). -
onDocumentLoaded
public SignalConnection<WebPage.DocumentLoadedCallback> onDocumentLoaded(WebPage.DocumentLoadedCallback handler) This signal is emitted when the DOM document of aWebKitWebPagehas been loaded.You can wait for this signal to get the DOM document
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDocumentLoaded
public void emitDocumentLoaded()Emits the "document-loaded" signal. SeeonDocumentLoaded(org.webkitgtk.webprocessextension.WebPage.DocumentLoadedCallback). -
onSendRequest
public SignalConnection<WebPage.SendRequestCallback> onSendRequest(WebPage.SendRequestCallback handler) This signal is emitted whenrequestis about to be sent to the server. This signal can be used to modify theWebKitURIRequestthat 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
requestargument containing the new request to be sent to the server due to the redirection and theredirectedResponseparameter containing the response received by the server for the initial request.Modifications to the
WebKitURIRequestand its associatedSoupMessageHeaderswill be taken into account when the request is sent over the network.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitSendRequest
public boolean emitSendRequest(@Nullable URIRequest request, @Nullable URIResponse redirectedResponse) Emits the "send-request" signal. SeeonSendRequest(org.webkitgtk.webprocessextension.WebPage.SendRequestCallback). -
onUserMessageReceived
public SignalConnection<WebPage.UserMessageReceivedCallback> onUserMessageReceived(WebPage.UserMessageReceivedCallback handler) This signal is emitted when aWebKitUserMessageis received from theWebKitWebViewcorresponding 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
messageand returningtrue. If the last reference ofmessageis removed and the message has been replied, the operation in theWebKitWebViewwill finish with errorUserMessageError.USER_MESSAGE_UNHANDLED_MESSAGE.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.28
- See Also:
-
emitUserMessageReceived
Emits the "user-message-received" signal. SeeonUserMessageReceived(org.webkitgtk.webprocessextension.WebPage.UserMessageReceivedCallback). -
builder
AWebPage.Builderobject constructs aWebPagewith the specified properties. Use the variousset...()methods to set properties, and finish construction withWebPage.Builder.build().- Returns:
- the builder object
-