It derives from <WebKitWebViewBase>.
The central class of the WPE WebKit and WebKitGTK APIs.
<WebKitWebView> 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
<WebKitWebView> or a data string. With
<WebKitSettings> you can control various aspects
of the rendering and loading of the content.
Note that in WebKitGTK, <WebKitWebView> is
scrollable by itself, so you don’t need to embed it in a
<GtkScrolledWindow>.
parent-instanceprivThe
<WebKitAutomationBrowsingContextPresentation>
of <WebKitWebView>. This should only be used when
creating a new <WebKitWebView> as a response to
automation-session:create-web-view signal request. If
the new WebView was added to a new tab of current browsing context
window tab should be
used.
Its value is a
<WebKitAutomationBrowsingContextPresentation>
(or, to set it, one of its symbols).
It can only be set when the object is made, with
#:automation-presentation-type.
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
active.
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 none or
muted.
If the capture state of the device is set to
none the web-page can still re-request
the permission to the user. Permission desision caching is left to the
application.
Its value is a <WebKitMediaCaptureState>
(or, to set it, one of its symbols).
Set it with (set! (web-view:camera-capture-state self) value).
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
<WebKitUserContentManager> and
webkit_web_view_run_javascript().
Policies are additive so if a website sets its own policy it still applies on top of the policy set here.
Its value is a string, or #f.
It can only be set when the object is made, with
#:default-content-security-policy.
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 active.
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 none or
muted.
If the capture state of the device is set to
none the web-page can still re-request
the permission to the user. Permission desision caching is left to the
application.
Its value is a <WebKitMediaCaptureState>
(or, to set it, one of its symbols).
Set it with (set! (web-view:display-capture-state self) value).
Whether the pages loaded inside <WebKitWebView>
are editable. For more information see web-view:set-editable.
Its value is a boolean.
Set it with (set! (web-view:editable self) value).
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.
Its value is a real number.
It is read only.
The favicon currently associated to the
<WebKitWebView>. See web-view:get-favicon for more details.
Its value is a <GdkTexture>, or #f.
It is read only.
Whether the <WebKitWebView> is controlled by
automation tools (e.g. WebDriver, Selenium). This is required for
views returned as a response to automation-session:create-web-view signal, alongside
any view you want to control during an automation session.
As a construct-only, you need to set it
during construction and it can’t be modified.
If web-view:related-view is
also passed during construction, web-view:is-controlled-by-automation
ignores its own parameter and inherits directly from the related view
web-view:is-controlled-by-automation
property. This is the recommended way when creating new views as a
response to the web-view:create
signal. For example, as response to JavaScript window.open()
calls during an automation session.
Its value is a boolean.
It can only be set when the object is made, with
#:is-controlled-by-automation.
Whether the <WebKitWebView> is in immersive mode.
Its value is a boolean.
It is read only.
Whether the <WebKitWebView> is currently loading a
page. This property becomes #t as soon as a new load operation
is requested and before the web-view:load-changed signal is emitted with
started and at that point the active URI is the
requested one. When the load operation finishes the property is set to
#f before web-view:load-changed is emitted with
finished.
Its value is a boolean.
It is read only.
Whether the <WebKitWebView> audio is muted. When
#t, audio is silenced. It may still be playing, i.e.
web-view:is-playing-audio may be #t.
Its value is a boolean.
Set it with (set! (web-view:is-muted self) value).
Whether the <WebKitWebView> is currently playing
audio from a page. This property becomes #t 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 #f.
Its value is a boolean.
It is read only.
Whether the web process currently associated to the
<WebKitWebView> is responsive.
Its value is a boolean.
It is read only.
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
active.
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 none or
muted.
If the capture state of the device is set to
none the web-page can still re-request
the permission to the user. Permission desision caching is left to the
application.
Its value is a <WebKitMediaCaptureState>
(or, to set it, one of its symbols).
Set it with (set! (web-view:microphone-capture-state self)
value).
The <WebKitNetworkSession> of the view
Its value is a <WebKitNetworkSession>, or
#f.
It can only be set when the object is made, with
#:network-session.
The identifier of the WebKitWebPage corresponding to the
<WebKitWebView>.
Its value is an unsigned 64-bit integer.
It is read only.
The related <WebKitWebView> 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.
Its value is a <WebKitWebView>, or #f.
It can only be set when the object is made, with #:related-view.
It cannot be read.
The <WebKitSettings> of the view.
Its value is a <WebKitSettings>, or #f.
It can only be set, with (set! (web-view:settings self) value).
The theme color of the WebView’s current page.
Its value is a <GdkRGBA>, or #f.
It is read only.
The main frame document title of this
<WebKitWebView>. If the title has not been
received yet, it will be #f.
Its value is a string, or #f.
It is read only.
The current active URI of the <WebKitWebView>. See
web-view:get-uri for more details.
Its value is a string, or #f.
It is read only.
The <WebKitUserContentManager> of the
view.
Its value is a
<WebKitUserContentManager>, or
#f.
It can only be set when the object is made, with
#:user-content-manager.
The <WebKitWebContext> of the view.
Its value is a <WebKitWebContext>, or
#f.
It can only be set when the object is made, with #:web-context.
This configures web-view 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.
Its value is a <WebKitWebExtensionMode>
(or, to set it, one of its symbols).
It can only be set when the object is made, with
#:web-extension-mode.
The <WebKitWebsitePolicies> for the view.
Its value is a <WebKitWebsitePolicies>, or
#f.
It can only be set when the object is made, with
#:website-policies.
The zoom level of the <WebKitWebView> content. See
web-view:set-zoom-level for more
details.
Its value is a real number.
Set it with (set! (web-view:zoom-level self) value).
Asynchronously call body with arguments in the script world
with name world-name of the main frame current context in
self. 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 world-name is #f, the
default world is used. Any value that is not #f is a distin ct
world. The source-uri 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:enable-javascript is #f, 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:enable-javascript-markup.
When the operation is finished, callback will be called. You can
then call web-view:call-async-javascript-function-finish
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:
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);
}
Passed: a <WebKitWebView>.
Passed: a string.
the function body
Passed: a 64-bit integer.
length of body, or -1 if body is a nul-terminated string
Passed, or left out: a <GVariant>, or
#f.
a <GVariant> with format a{sv}
storing the function arguments, or #f
Passed, or left out: a string, or #f.
the name of a WebKitScriptWorld or #f to use the default
Passed, or left out: a string, or #f.
the source URI
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when
the script finished
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:call-async-javascript-function.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a <JSCValue>.
a <JSCValue> with the return value of
the async function or #f in case of error
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 web-view:can-execute-editing-command-finish?
to get the result of the operation.
Passed: a <WebKitWebView>.
Passed: a string.
the command to check
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when
the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:can-execute-editing-command.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the editing command can be executed or #f otherwise
Determines whether self has a previous history item.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if able to move back or #f otherwise.
Determines whether self has a next history item.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if able to move forward or #f otherwise.
Whether or not a MIME type can be displayed in self.
Passed: a <WebKitWebView>.
Passed: a string.
a MIME type
Returned: a boolean.
#t if the MIME type mime-type can be displayed or #f
otherwise
Requests downloading of the specified URI string for self.
Passed: a <WebKitWebView>.
Passed: a string.
the URI to download
Returned: a <WebKitDownload>.
a new <WebKitDownload> representing the download
operation.
Asynchronously evaluate script in the script world with name
world-name of the main frame current context in self. If
world-name is #f, the default world is used. Any value
that is not #f is a distinct world. The source-uri 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:enable-javascript is #f, 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:enable-javascript-markup.
When the operation is finished, callback will be called. You can
then call web-view:evaluate-javascript-finish to get
the result of the operation.
This is an example of using web-view:evaluate-javascript with a script
returning a string:
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);
}
Passed: a <WebKitWebView>.
Passed: a string.
the script to evaluate
Passed: a 64-bit integer.
length of script, or -1 if script is a nul-terminated string
Passed, or left out: a string, or #f.
the name of a WebKitScriptWorld or #f to use the default
Passed, or left out: a string, or #f.
the source URI
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when
the script finished
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:evaluate-javascript.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a <JSCValue>.
a <JSCValue> with the result of the
last executed statement in script or #f in case of error
Request to execute the given command for self.
You can use web-view:can-execute-editing-command to
check whether it’s possible to execute the command.
Passed: a <WebKitWebView>.
Passed: a string.
the command to execute
Request to execute the given command with argument for self.
You can use web-view:can-execute-editing-command to
check whether it’s possible to execute the command.
Passed: a <WebKitWebView>.
Passed: a string.
the command to execute
Passed: a string.
the command argument
Get the presentation type of <WebKitWebView> when
created for automation.
Passed: a <WebKitWebView>.
Returned: a
<WebKitAutomationBrowsingContextPresentation>.
Obtains the <WebKitBackForwardList>
associated with the given <WebKitWebView>.
The <WebKitBackForwardList> is owned by
the <WebKitWebView>.
Passed: a <WebKitWebView>.
Returned: a <WebKitBackForwardList>.
Gets the color that is used to draw the self background.
Gets the color that is used to draw the self background before the
actual contents are rendered. For more information see also
web-view:set-background-color
Passed: a <WebKitWebView>.
Passed, filled in, and returned: a <GdkRGBA>.
a <GdkRGBA> to fill in with the background color
Get the camera capture state of a <WebKitWebView>.
Passed: a <WebKitWebView>.
Returned: a <WebKitMediaCaptureState>.
The <WebKitMediaCaptureState> of the
camera device. If enable-mediastream is #f, this method
will return none.
Gets the web context of self.
Passed: a <WebKitWebView>.
Returned: a <WebKitWebContext>.
the <WebKitWebContext> of the view
Returns the current custom character encoding name of self.
Passed: a <WebKitWebView>.
Returned: a string.
the current custom character encoding name or #f if no custom
character encoding has been set.
Gets the configured default Content-Security-Policy.
Passed: a <WebKitWebView>.
Returned: a string, or #f.
The default policy or #f
Get the display capture state of a
<WebKitWebView>.
Passed: a <WebKitWebView>.
Returned: a <WebKitMediaCaptureState>.
The <WebKitMediaCaptureState> of the
display device. If enable-mediastream is #f, this method
will return none.
Gets the web editor state of self.
Passed: a <WebKitWebView>.
Returned: a <WebKitEditorState>.
the <WebKitEditorState> of the view
Gets the value of the web-view:estimated-load-progress property.
You can monitor the estimated progress of a load operation by connecting to the notify::estimated-load-progress signal of self.
Passed: a <WebKitWebView>.
Returned: a real number.
an estimate of the of the percent complete for a document load as a range from 0.0 to 1.0.
Returns favicon currently associated to self.
Returns favicon currently associated to self, if any. You can connect to notify::favicon signal of self to be notified when the favicon is available.
Passed: a <WebKitWebView>.
Returned: a <GdkTexture>.
the favicon image or #f if there’s no icon associated with
self.
Gets the <WebKitFindController>.
Gets the <WebKitFindController> that will
allow the caller to query the <WebKitWebView> for
the text to look for.
Passed: a <WebKitWebView>.
the <WebKitWebView>
Returned: a <WebKitFindController>.
the <WebKitFindController> associated to
this particular <WebKitWebView>.
Get the <WebKitInputMethodContext>
currently in use by self.
Get the <WebKitInputMethodContext>
currently in use by self, or #f if no input method is being
used.
Passed: a <WebKitWebView>.
Returned: a <WebKitInputMethodContext>,
or #f.
a <WebKitInputMethodContext>, or
#f
Get the <WebKitWebInspector> associated to
self
Passed: a <WebKitWebView>.
Returned: a <WebKitWebInspector>.
the <WebKitWebInspector> of self
Gets the mute state of self.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if self audio is muted or #f is audio is not
muted.
Get whether the current web process of a
<WebKitWebView> is responsive.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if the web process attached to self is responsive, or
#f otherwise.
Return the main resource of self.
Passed: a <WebKitWebView>.
Returned: a <WebKitWebResource>.
the main <WebKitWebResource> of the view or
#f if nothing has been loaded.
Get the microphone capture state of a
<WebKitWebView>.
Passed: a <WebKitWebView>.
Returned: a <WebKitMediaCaptureState>.
The <WebKitMediaCaptureState> of the
microphone device. If enable-mediastream is #f, this
method will return none.
Get the <WebKitNetworkSession> associated
to self.
Passed: a <WebKitWebView>.
Returned: a <WebKitNetworkSession>.
Get the identifier of the WebKitWebPage corresponding to the
<WebKitWebView>
Passed: a <WebKitWebView>.
Returned: an unsigned 64-bit integer.
the page ID of self.
Gets the current session state of self
Passed: a <WebKitWebView>.
Returned: a
<WebKitWebViewSessionState>.
Gets the <WebKitSettings> currently applied to
self.
If no other <WebKitSettings> have been explicitly
applied to self with web-view:set-settings, the default
<WebKitSettings> will be returned. This method
always returns a valid <WebKitSettings> object.
To modify any of the self settings, you can either create a new
<WebKitSettings> object with settings:new, setting the desired preferences, and then replace
the existing self settings with web-view:set-settings or get the existing self
settings and update it directly. <WebKitSettings>
objects can be shared by multiple
<WebKitWebView><!– –>s, so modifying the
settings of a <WebKitWebView> would affect other
<WebKitWebView><!– –>s using the same
<WebKitSettings>.
Passed: a <WebKitWebView>.
Returned: a <WebKitSettings>.
the <WebKitSettings> attached to self
Asynchronously retrieves a snapshot of self for region.
options specifies how the snapshot should be rendered.
When the operation is finished, callback will be called. You must
call web-view:get-snapshot-finish to get the result of
the operation.
Passed: a <WebKitWebView>.
Passed: a <WebKitSnapshotRegion>, or one of
its symbols.
the <WebKitSnapshotRegion> for this
snapshot
Passed: a <WebKitSnapshotOptions>, or a
list of its symbols, or one of them.
<WebKitSnapshotOptions> for the snapshot
Passed, or left out: a <GCancellable>, or
#f.
Passed, or left out: a procedure, or #f.
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
user data
Finishes an asynchronous operation started with web-view:get-snapshot, producing an image of the
snapshot using the BGRA8888 pixel format.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a <GdkTexture>.
an image with the retrieved snapshot, or #f in case of error.
Gets the theme color that is specified by the content in the self. If the self doesn’t have a theme color it will fill the rgba with transparent black content.
Passed: a <WebKitWebView>.
Passed, filled in, and returned: a <GdkRGBA>.
a <GdkRGBA> to fill in with the theme color
Returned: a boolean.
Whether the currently loaded page defines a theme color.
Gets the value of the web-view:title property.
You can connect to notify::title signal of self to be notified when the title has been received.
Passed: a <WebKitWebView>.
Returned: a string.
The main frame document title of self.
Retrieves the <GTlsCertificate>
associated with the main resource of self.
Retrieves the <GTlsCertificate>
associated with the main resource of self, and the
<GTlsCertificateFlags> showing
what problems, if any, have been found with that certificate. If the
connection is not HTTPS, this function returns #f. This function
should be called after a response has been received from the server, so
you can connect to web-view:load-changed and call this function when it’s
emitted with committed event.
Note that this function provides no information about the security of
the web page if the current
<WebKitTLSErrorsPolicy> is
ignore, 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
<WebKitTLSErrorsPolicy> is
fail, in which case subresources that fail
certificate verification will be blocked.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if the self connection uses HTTPS and a response has
been received from the server, or #f otherwise.
Returned: a <GTlsCertificate>.
return location for a <GTlsCertificate>
Returned: a
<GTlsCertificateFlags>.
return location for a
<GTlsCertificateFlags> the
verification status of certificate
Returns the current active URI of self.
The active URI might change during a load operation:
#f.
web-view:load-uri, the requested URI is the given one.
web-view:load-html, the requested URI is "about:blank".
web-view:load-alternate-html, the requested URI
is content URI provided.
web-view:go-back or web-view:go-forward, the requested URI is the original URI
of the previous/next item in the
<WebKitBackForwardList> of self.
web-view:go-to-back-forward-list-item,
the requested URI is the opriginal URI of the given
<WebKitBackForwardListItem>.
web-view:load-changed is emitted with
redirected event, the active URI is already
updated to the redirected URI.
web-view:load-changed is emitted with
committed 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.
You can monitor the active URI by connecting to the notify::uri signal of self.
Passed: a <WebKitWebView>.
Returned: a string.
the current active URI of self or #f if nothing has been
loaded yet.
Gets the user content manager associated to self.
Passed: a <WebKitWebView>.
Returned: a <WebKitUserContentManager>.
the <WebKitUserContentManager>
associated with the view
Get the view’s <WebKitWebExtensionMode>.
Passed: a <WebKitWebView>.
Returned: a <WebKitWebExtensionMode>.
Gets the default website policies.
Gets the default website policies set on construction in the self.
These can be overridden on a per-origin basis via the web-view:decide-policy signal handler.
See also policy-decision:use-with-policies.
Passed: a <WebKitWebView>.
Returned: a <WebKitWebsitePolicies>.
the default <WebKitWebsitePolicies>
associated with the view.
Get the <WebKitWindowProperties> object.
Get the <WebKitWindowProperties> object
containing the properties that the window containing self should
have.
Passed: a <WebKitWebView>.
Returned: a <WebKitWindowProperties>.
the <WebKitWindowProperties> of
self
Set the zoom level of self.
Get the zoom level of self, i.e. the factor by which the view contents are scaled with respect to their original size.
Passed: a <WebKitWebView>.
Returned: a real number.
the current zoom level of self
Loads the previous history item.
You can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Loads the next history item.
You can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Loads the specific history item list-item.
You can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a <WebKitBackForwardListItem>.
Get whether a <WebKitWebView> was created with
web-view:is-controlled-by-automation
property enabled.
Only <WebKitWebView><!– –>s controlled by
automation can be used in an automation session.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if self is controlled by automation, or #f
otherwise.
Gets whether the user is allowed to edit the HTML document.
When self 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
<WebKitWebView> is not editable.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if the user is allowed to edit the HTML document, or #f
otherwise.
Gets whether self is in immersive mode.
An immersive session is a mode in which the user is presented with a fully immersive XR experience (such as VR or AR), typically rendered via a headset.
Note that if WebXR is disabled or OPENXR is not used, this API always
returns #f.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if the self is in immersive mode, or #f
otherwise.
Gets the value of the web-view:is-loading property.
You can monitor when a <WebKitWebView> is loading
a page by connecting to notify::is-loading signal of self. 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.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if self is loading a page or #f otherwise.
Gets the value of the web-view:is-playing-audio property.
You can monitor when a page in a <WebKitWebView>
is playing audio by connecting to the notify::is-playing-audio signal of
self. This is useful when the application wants to provide visual
feedback when a page is producing sound.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t if a page in self is playing audio or #f
otherwise.
Requests to leave the immersive mode this
<WebKitWebView> is in.
Users interact with web content to start XR sessions, and can typically end the sessions themselves, but applications might need to end a session on their own based on application or platform logic.
Note that if WebXR is disabled, or if it is enabled but the self
is not in immersive mode, this API does nothing. See also
web-view:is-immersive-mode-enabled?.
Passed: a <WebKitWebView>.
Load the given content string for the URI content-uri.
This allows clients to display page-loading errors in the
<WebKitWebView> itself. When this method is
called from web-view:load-failed signal to show an error page, then
the back-forward list is maintained appropriately. For everything else
this method works the same way as web-view:load-html.
Passed: a <WebKitWebView>.
Passed: a string.
the new content to display as the main page of the self
Passed: a string.
the URI for the alternate page content
Passed, or left out: a string, or #f.
the base URI for relative locations or #f
Load the specified bytes into self using the given mime-type and encoding.
When mime-type is #f, it defaults to "text/html". When
encoding is #f, it defaults to "UTF-8". When
base-uri is #f, it defaults to "about:blank". You can
monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a <GBytes>.
input data to load
Passed, or left out: a string, or #f.
the MIME type of bytes, or #f
Passed, or left out: a string, or #f.
the character encoding of bytes, or #f
Passed, or left out: a string, or #f.
the base URI for relative locations or #f
Load the given content string with the specified base-uri.
If base-uri is not #f, relative URLs in the content
will be resolved against base-uri and absolute local paths must be
children of the base-uri. For security reasons absolute local
paths that are not children of base-uri will cause the web process
to terminate. If you need to include URLs in content that are
local paths in a different directory than base-uri you can build a
data URI for them. When base-uri is #f, it defaults to
"about:blank". The mime type of the document will be "text/html". You
can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a string.
The HTML string to load
Passed, or left out: a string, or #f.
The base URI for relative locations or #f
Load the specified plain-text string into self.
The mime type of document will be "text/plain". You can monitor the
load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a string.
The plain text to load
Requests loading of the specified
<WebKitURIRequest>.
You can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a <WebKitURIRequest>.
a <WebKitURIRequest> to load
Requests loading of the specified URI string.
You can monitor the load operation by connecting to web-view:load-changed signal.
Passed: a <WebKitWebView>.
Passed: a string.
an URI string
Creates a new <WebKitWebView> with the default
<WebKitWebContext>.
Creates a new <WebKitWebView> with the default
<WebKitWebContext> and no
<WebKitUserContentManager> associated
with it. See also webkit_web_view_new_with_context(),
webkit_web_view_new_with_user_content_manager(), and
webkit_web_view_new_with_settings().
Returned: a <GtkWidget>.
The newly created <WebKitWebView> widget
Reloads the current contents of self.
See also web-view:reload-bypass-cache.
Passed: a <WebKitWebView>.
Reloads the current contents of self without using any cached data.
Passed: a <WebKitWebView>.
Restore the self session state from state
Passed: a <WebKitWebView>.
Passed: a <WebKitWebViewSessionState>.
Asynchronously save the current web page.
Asynchronously save the current web page associated to the
<WebKitWebView> into a self-contained format using
the mode specified in save-mode.
When the operation is finished, callback will be called. You can
then call web-view:save-finish to get
the result of the operation.
Passed: a <WebKitWebView>.
Passed: a <WebKitSaveMode>, or one of its
symbols.
the <WebKitSaveMode> specifying how the web page
should be saved.
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when
the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:save.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a <GInputStream>.
a <GInputStream> with the result of saving
the current web page or #f in case of error.
Asynchronously save the current web page.
Asynchronously save the current web page associated to the
<WebKitWebView> into a self-contained format using
the mode specified in save-mode and writing it to file.
When the operation is finished, callback will be called. You can
then call web-view:save-to-file-finish? to get the result
of the operation.
Passed: a <WebKitWebView>.
Passed: a <GFile>.
the <GFile> where the current web page should be
saved to.
Passed: a <WebKitSaveMode>, or one of its
symbols.
the <WebKitSaveMode> specifying how the web page
should be saved.
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when
the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:save-to-file.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the web page was successfully saved to a file or #f
otherwise.
Send message to the WebKitWebPage corresponding to
self.
If message is floating, it’s consumed. If you don’t expect any
reply, or you simply want to ignore it, you can pass #f as
callback. When the operation is finished, callback will be
called. You can then call web-view:send-message-to-page-finish to
get the message reply.
Passed: a <WebKitWebView>.
Passed: a <WebKitUserMessage>.
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f to ignore
Passed, or left out: a procedure, or #f.
(nullable): A GAsyncReadyCallback
to call when the request is satisfied or #f
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finish an asynchronous operation started with web-view:send-message-to-page.
Passed: a <WebKitWebView>.
Passed: a <GAsyncResult>.
Returned: a <WebKitUserMessage>.
a <WebKitUserMessage> with the reply or
#f in case of error.
Sets the color that will be used to draw the self background.
Sets the color that will be used to draw the self background before the actual contents are rendered. Note that if the web page loaded in self specifies a background color, it will take precedence over the rgba color. By default the self background color is opaque white.
Passed: a <WebKitWebView>.
Passed: a <GdkRGBA>.
Set the camera capture state of a <WebKitWebView>.
If enable-mediastream is #f, this method will have no
visible effect. Once the state of the device has been set to
none it cannot be changed anymore. The
page can however request capture again using the mediaDevices API.
Passed: a <WebKitWebView>.
Passed: a <WebKitMediaCaptureState>, or
one of its symbols.
Sets the allowlist for CORS.
Sets the allowlist for which
Cross-Origin
Resource Sharing checks are disabled in self. 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.
Passed: a <WebKitWebView>.
Passed, or left out: a list or vector, each a string, or #f.
an allowlist of URI patterns, or #f
Sets the current custom character encoding override of self.
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 #f removes the character encoding override.
Passed: a <WebKitWebView>.
Passed, or left out: a string, or #f.
a character encoding name or #f
Set the display capture state of a
<WebKitWebView>.
If enable-mediastream is #f, this method will have no
visible effect. Once the state of the device has been set to
none it cannot be changed anymore. The
page can however request capture again using the mediaDevices API.
Passed: a <WebKitWebView>.
Passed: a <WebKitMediaCaptureState>, or
one of its symbols.
Sets whether the user is allowed to edit the HTML document.
If editable is #t, self allows the user to edit the
HTML document. If editable is #f, an element in
self’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 <WebKitWebView> 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 <WebKitWebView> editable without
altering the document or DOM structure.
Passed: a <WebKitWebView>.
Passed: a boolean.
a gboolean indicating the editable state
Set the <WebKitInputMethodContext> to
be used by self.
Set the <WebKitInputMethodContext> to
be used by self, or #f to not use any input method. Note
that the same
<WebKitInputMethodContext> can’t be set
on more than one <WebKitWebView> at the same time.
Passed: a <WebKitWebView>.
Passed, or left out: a
<WebKitInputMethodContext>, or
#f.
the <WebKitInputMethodContext> to set,
or #f
Sets the mute state of self.
Passed: a <WebKitWebView>.
Passed: a boolean.
mute flag
Set the microphone capture state of a
<WebKitWebView>.
If enable-mediastream is #f, this method will have no
visible effect. Once the state of the device has been set to
none it cannot be changed anymore. The
page can however request capture again using the mediaDevices API.
Passed: a <WebKitWebView>.
Passed: a <WebKitMediaCaptureState>, or
one of its symbols.
Sets the <WebKitSettings> to be applied to
self.
The existing <WebKitSettings> of self will
be replaced by settings. New settings are applied immediately on
self. The same <WebKitSettings> object can
be shared by multiple <WebKitWebView><!– –>s.
Passed: a <WebKitWebView>.
Passed: a <WebKitSettings>.
Set the zoom level of self.
Set the zoom level of self, i.e. the factor by which the view contents are scaled with respect to their original size.
Passed: a <WebKitWebView>.
Passed: a real number.
the zoom level
Stops any ongoing loading operation in self.
This method does nothing if no content is being loaded. If there is a
loading operation in progress, it will be cancelled and
web-view:load-failed signal
will be emitted with cancelled error.
Passed: a <WebKitWebView>.
Terminates the web process associated to self.
When the web process gets terminated using this method, the
web-view:web-process-terminated signal is
emitted with terminated-by-api
as the reason for termination.
Passed: a <WebKitWebView>.
Tries to close the self.
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 web-view:close signal is emitted, otherwise nothing happens.
Passed: a <WebKitWebView>.
Connect a handler with (connect object web-view:authenticate
handler). It is called as (handler self request) ⇒ %return.
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
<WebKitAuthenticationRequest> in the
request argument. To handle this signal asynchronously you should
keep a ref of the request and return #t. To disable HTTP
authentication entirely, connect to this signal and simply return
#t.
The default signal handler will run a default authentication dialog asynchronously for the user to interact with.
Passed: a <WebKitWebView>.
Passed: a
<WebKitAuthenticationRequest>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:close handler).
It is called as (handler self).
Emitted when closing a <WebKitWebView> is
requested. This occurs when a call is made from JavaScript’s
window.close() function or after trying to close the
web-view with web-view:try-close.
It is the owner’s responsibility to handle this signal to hide or
destroy the <WebKitWebView>, if necessary.
Passed: a <WebKitWebView>.
Connect a handler with (connect object web-view:context-menu
handler). It is called as (handler self context-menu
hit-test-result) ⇒ %return.
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.
context-menu:prepend, context-menu:append or context-menu:insert to add new
<WebKitContextMenuItem><!– –>s to
context-menu, context-menu:move-item to reorder existing items, or
context-menu:remove to remove an
existing item. The signal handler should return #f, and the menu
represented by context-menu will be shown.
#t so that the proposed menu will not be shown.
context-menu:remove-all, add
your own items and return #f so that the menu will be shown. You
can also ignore the proposed
<WebKitContextMenu>, build your own
GtkMenu and return #t to prevent the proposed menu from
being shown.
If the signal handler returns #f the context menu represented by
context-menu will be shown, if it return #t the context
menu will not be shown.
The proposed <WebKitContextMenu> passed in
context-menu argument is only valid during the signal emission.
Passed: a <WebKitWebView>.
Passed: a <WebKitContextMenu>.
the proposed <WebKitContextMenu>
Passed: a <WebKitHitTestResult>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object
web-view:context-menu-dismissed handler). It is called as
(handler self).
Emitted after web-view:context-menu signal, if the context menu is
shown, to notify that the context menu is dismissed.
Passed: a <WebKitWebView>.
Connect a handler with (connect object web-view:create handler).
It is called as (handler self navigation-action) ⇒ %return.
Emitted when the creation of a new <WebKitWebView>
is requested. If this signal is handled the signal handler should
return the newly created <WebKitWebView>.
The <WebKitNavigationAction> parameter
contains information about the navigation action that triggered this
signal.
The new <WebKitWebView> must be related to
web-view, see web-view:related-view for more details.
The new <WebKitWebView> should not be displayed to
the user until the web-view:ready-to-show signal is emitted.
For creating views as response to automation tools requests, see the
automation-session:create-web-view signal.
Passed: a <WebKitWebView>.
Passed: a <WebKitNavigationAction>.
Returned: a <GtkWidget>.
a newly allocated <WebKitWebView> widget or
#f to propagate the event further.
Connect a handler with (connect object web-view:decide-policy
handler). It is called as (handler self decision decision-type)
⇒ %return.
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
<WebKitNavigationPolicyDecision>
passed in the decision argument is a generic type, but should be
casted to a more specific type when making the decision. For example:
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
object:ref on the decision
argument and returning #t to block the default signal handler. If
the last reference is removed on a
<WebKitPolicyDecision> and no decision has
been made explicitly, policy-decision:use will be the default policy decision. The
default signal handler will simply call policy-decision:use. Only the first policy decision chosen for a
given <WebKitPolicyDecision> will have any
affect.
Passed: a <WebKitWebView>.
Passed: a <WebKitPolicyDecision>.
Passed: a <WebKitPolicyDecisionType>.
a <WebKitPolicyDecisionType> denoting
the type of decision
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:enter-fullscreen
handler). It is called as (handler self) ⇒ %return.
Emitted when JavaScript code calls
element.webkitRequestFullScreen(). If the signal is not handled
the <WebKitWebView> 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).
Passed: a <WebKitWebView>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to continue emission of the event.
Connect a handler with (connect object
web-view:insecure-content-detected handler). It is called as
(handler self event).
Prior to 2.46, this signal was emitted when insecure content was loaded in a secure content. Since 2.46, this signal is generally no longer emitted.
Passed: a <WebKitWebView>.
Passed: a <WebKitInsecureContentEvent>.
the WebKitInsecureContentEvent
Connect a handler with (connect object web-view:leave-fullscreen
handler). It is called as (handler self) ⇒ %return.
Emitted when the <WebKitWebView> 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
web-view:enter-fullscreen
stage for instance.
Passed: a <WebKitWebView>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to continue emission of the event.
Connect a handler with (connect object web-view:load-changed
handler). It is called as (handler self load-event).
Emitted when a load operation in web-view changes. The signal is
always emitted with started when a new load
request is made and finished when the load
finishes successfully or due to an error. When the ongoing load
operation fails web-view:load-failed signal is emitted before
web-view:load-changed is
emitted with finished. If a redirection is
received from the server, this signal is emitted with
redirected after the initial emission with
started and before
committed. When the page content starts
arriving the signal is emitted with committed
event.
You can handle this signal and use a switch to track any ongoing load operation.
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;
}
}
Passed: a <WebKitWebView>.
Passed: a <WebKitLoadEvent>.
Connect a handler with (connect object web-view:load-failed
handler). It is called as (handler self load-event failing-uri
error) ⇒ %return.
Emitted when an error occurs during a load operation. If the error
happened when starting to load data for a page load-event will be
started. If it happened while loading a
committed data source load-event will be
committed. Since a load error causes the load
operation to finish, the signal WebKitWebView::load-changed will always
be emitted with finished 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.
Passed: a <WebKitWebView>.
Passed: a <WebKitLoadEvent>.
the <WebKitLoadEvent> of the load operation
Passed: a string.
the URI that failed to load
Passed: a <GError>.
the <GError> that was triggered
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object
web-view:load-failed-with-tls-errors handler). It is called as
(handler self failing-uri certificate errors) ⇒ %return.
Emitted when a TLS error occurs during a load operation. To allow an
exception for this certificate and the host of failing-uri
use webkit_web_context_allow_tls_certificate_for_host().
To handle this signal asynchronously you should call object:ref on certificate and return #t.
If #f is returned, web-view:load-failed will be emitted. The load will
finish regardless of the returned value.
Passed: a <WebKitWebView>.
Passed: a string.
the URI that failed to load
Passed: a <GTlsCertificate>.
Passed: a <GTlsCertificateFlags>.
a <GTlsCertificateFlags> with the
verification status of certificate
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object
web-view:mouse-target-changed handler). It is called as (handler
self hit-test-result modifiers).
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 hit-test-result
argument. The modifiers argument is a bitmask of
<GdkModifierType> 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 hit-test-result.
Passed: a <WebKitWebView>.
Passed: a <WebKitHitTestResult>.
Passed: an unsigned 32-bit integer.
a bitmask of <GdkModifierType>
Connect a handler with (connect object web-view:permission-request
handler). It is called as (handler self request) ⇒ %return.
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:
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 object:ref on the request
argument and returning #t to block the default signal handler. If
the last reference is removed on a
<WebKitPermissionRequest> and the
request has not been handled, permission-request:deny will be the default action.
If the signal is not handled, the request will be completed
automatically by the specific
<WebKitPermissionRequest> that could
allow or deny it. Check the documentation of classes implementing
<WebKitPermissionRequest> interface to
know their default action.
Passed: a <WebKitWebView>.
Passed: a <WebKitPermissionRequest>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:print handler).
It is called as (handler self print-operation) ⇒ %return.
Emitted when printing is requested on web-view, 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
print-operation to be used as default values in the print dialog.
You can call print-operation:set-print-settings and
print-operation:set-page-setup and then return
#f to propagate the event so that the print dialog is shown.
You can connect to this signal and return #t to cancel the print
operation or implement your own print dialog.
Passed: a <WebKitWebView>.
Passed: a <WebKitPrintOperation>.
the <WebKitPrintOperation> that will handle
the print request
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object
web-view:query-permission-state handler). It is called as
(handler self query) ⇒ %return.
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 permission-state-query:finish.
You can handle the query asynchronously by calling
permission-state-query:ref on
query and returning #t. 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.
Passed: a <WebKitWebView>.
Passed: a
<WebKitPermissionStateQuery>.
Returned: a boolean.
#t if the message was handled, or #f otherwise.
Connect a handler with (connect object web-view:ready-to-show
handler). It is called as (handler self).
Emitted after web-view:create on the
newly created <WebKitWebView> 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 <WebKitWindowProperties> of
web-view. See also web-view:get-window-properties.
Passed: a <WebKitWebView>.
Connect a handler with (connect object
web-view:resource-load-started handler). It is called as
(handler self resource request).
Emitted when a new resource is going to be loaded. The request
parameter contains the <WebKitURIRequest> that
will be sent to the server. You can monitor the load operation by
connecting to the different signals of resource.
Passed: a <WebKitWebView>.
Passed: a <WebKitWebResource>.
Passed: a <WebKitURIRequest>.
Connect a handler with (connect object web-view:run-as-modal
handler). It is called as (handler self).
Emitted after web-view:ready-to-show on the newly created
<WebKitWebView> when JavaScript code calls
window.showModalDialog(). 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 <WebKitWebView> until
the new dialog is closed.
Passed: a <WebKitWebView>.
Connect a handler with (connect object web-view:run-color-chooser
handler). It is called as (handler self request) ⇒ %return.
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
<WebKitColorChooserRequest> 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
GtkColorChooser for the user to interact with.
Passed: a <WebKitWebView>.
Passed: a <WebKitColorChooserRequest>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:run-file-chooser
handler). It is called as (handler self request) ⇒ %return.
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
<WebKitFileChooserRequest> in the
request argument.
The default signal handler will asynchronously run a regular
GtkFileChooserDialog for the user to interact with.
Passed: a <WebKitWebView>.
Passed: a <WebKitFileChooserRequest>.
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:script-dialog
handler). It is called as (handler self dialog) ⇒ %return.
Emitted when JavaScript code calls window.alert(),
window.confirm() or window.prompt(), or when
onbeforeunload() 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:
alert: message dialog with a single Close
button.
confirm: message dialog with OK and
Cancel buttons.
prompt: message dialog with OK and Cancel
buttons and a text entry with the default text.
before-unload-confirm: message dialog
with Stay and Leave buttons.
It is possible to handle the script dialog request asynchronously, by
simply caling script-dialog:ref on the
dialog argument and calling script-dialog:close when done. If the last reference is
removed on a <WebKitScriptDialog> and the
dialog has not been closed, script-dialog:close will be called.
Passed: a <WebKitWebView>.
Passed: a <WebKitScriptDialog>.
the <WebKitScriptDialog> to show
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:show-notification
handler). It is called as (handler self notification) ⇒
%return.
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.
Passed: a <WebKitWebView>.
Passed: a <WebKitNotification>.
Returned: a boolean.
#t to stop other handlers from being invoked. #f
otherwise.
Connect a handler with (connect object web-view:show-option-menu
handler). It is called as (handler self menu rectangle) ⇒
%return.
This signal is emitted when a select element in web-view 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
<WebKitWebView> is given as rectangle
parameter, it can be used to position the menu. To handle this signal
asynchronously you should keep a ref of the menu.
The default signal handler will pop up a GtkMenu.
Passed: a <WebKitWebView>.
Passed: a <WebKitOptionMenu>.
Passed: a <GdkRectangle>.
the option element area
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object web-view:submit-form
handler). It is called as (handler self request).
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 form-submission-request:submit is called.
It is possible to handle the form submission request asynchronously, by
simply calling object:ref on the
request argument and calling form-submission-request:submit when done to continue with the
form submission. If the last reference is removed on a
<WebKitFormSubmissionRequest> and
the form has not been submitted, form-submission-request:submit will be called.
Passed: a <WebKitWebView>.
Passed: a
<WebKitFormSubmissionRequest>.
Connect a handler with (connect object
web-view:user-message-received handler). It is called as
(handler self message) ⇒ %return.
This signal is emitted when a
<WebKitUserMessage> is received from the
WebKitWebPage corresponding to web-view. You can reply to
the message using user-message:send-reply.
You can handle the user message asynchronously by calling
object:ref on message and
returning #t. 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
message.
Passed: a <WebKitWebView>.
Passed: a <WebKitUserMessage>.
the <WebKitUserMessage> received
Returned: a boolean.
#t if the message was handled, or #f otherwise.
Connect a handler with (connect object
web-view:web-process-terminated handler). It is called as
(handler self reason).
This signal is emitted when the web process terminates abnormally due to reason.
Passed: a <WebKitWebView>.
Passed: a
<WebKitWebProcessTerminationReason>.
To override it in a new class, give register-type #:vfuncs
`((authenticate . ,procedure)). The procedure is called as
(procedure self request) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a
<WebKitAuthenticationRequest>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((close . ,procedure)). The procedure is called as (procedure
self).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
To override it in a new class, give register-type #:vfuncs
`((context-menu . ,procedure)). The procedure is called as
(procedure self context-menu hit-test-result) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitHitTestResult>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((context-menu-dismissed . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
To override it in a new class, give register-type #:vfuncs
`((decide-policy . ,procedure)). The procedure is called as
(procedure self decision type) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitPolicyDecision>.
Passed: a <WebKitPolicyDecisionType>,
or one of its symbols.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((enter-fullscreen . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((insecure-content-detected . ,procedure)). The procedure is called
as (procedure self event).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitInsecureContentEvent>, or one of its symbols.
To override it in a new class, give register-type #:vfuncs
`((leave-fullscreen . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((load-changed . ,procedure)). The procedure is called as
(procedure self load-event).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitLoadEvent>, or one of its
symbols.
To override it in a new class, give register-type #:vfuncs
`((load-failed . ,procedure)). The procedure is called as
(procedure self load-event failing-uri error) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitLoadEvent>, or one of its
symbols.
Passed: a string.
Passed: a <GError>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((load-failed-with-tls-errors . ,procedure)). The procedure is
called as (procedure self failing-uri certificate errors) ⇒
%return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a string.
Passed: a <GTlsCertificate>.
Passed: a <GTlsCertificateFlags>,
or a list of its symbols, or one of them.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((mouse-target-changed . ,procedure)). The procedure is called as
(procedure self hit-test-result modifiers).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitHitTestResult>.
Passed: an unsigned 32-bit integer.
To override it in a new class, give register-type #:vfuncs
`((permission-request . ,procedure)). The procedure is called as
(procedure self permission-request) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitPermissionRequest>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((print . ,procedure)). The procedure is called as (procedure
self print-operation) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitPrintOperation>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((query-permission-state . ,procedure)). The procedure is called as
(procedure self query) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a
<WebKitPermissionStateQuery>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((ready-to-show . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
To override it in a new class, give register-type #:vfuncs
`((resource-load-started . ,procedure)). The procedure is called as
(procedure self resource request).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitWebResource>.
Passed: a <WebKitURIRequest>.
To override it in a new class, give register-type #:vfuncs
`((run-as-modal . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
To override it in a new class, give register-type #:vfuncs
`((run-color-chooser . ,procedure)). The procedure is called as
(procedure self request) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitColorChooserRequest>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((run-file-chooser . ,procedure)). The procedure is called as
(procedure self request) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitFileChooserRequest>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((script-dialog . ,procedure)). The procedure is called as
(procedure self dialog) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitScriptDialog>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((show-notification . ,procedure)). The procedure is called as
(procedure self notification) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitNotification>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((show-option-menu . ,procedure)). The procedure is called as
(procedure self menu rectangle) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitOptionMenu>.
Passed: a <GdkRectangle>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((submit-form . ,procedure)). The procedure is called as
(procedure self request).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a
<WebKitFormSubmissionRequest>.
To override it in a new class, give register-type #:vfuncs
`((user-message-received . ,procedure)). The procedure is called as
(procedure self message) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a <WebKitUserMessage>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((web-process-crashed . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Returned: a boolean.
To override it in a new class, give register-type #:vfuncs
`((web-process-terminated . ,procedure)). The procedure is called as
(procedure self reason).
Passed: the class whose implementation to call:
<WebKitWebView>, or a class that derives from it,
or its GType number.
Passed: a <WebKitWebView>.
Passed: a
<WebKitWebProcessTerminationReason>,
or one of its symbols.