Class
WebKit2UserContentManager
Description [src]
class WebKit2.UserContentManager : GObject.Object {
parent: GObject
}
Manages user-defined content which affects web pages.
Using a WebKitUserContentManager
user CSS style sheets can be set to
be injected in the web pages loaded by a WebKitWebView
, by webkit_user_content_manager_add_style_sheet().
To use a WebKitUserContentManager
, it must be created using
webkit_user_content_manager_new(), and then passed to
webkit_web_view_new_with_user_content_manager(). User style
sheets can be created with webkit_user_style_sheet_new().
User style sheets can be added and removed at any time, but they will affect the web pages loaded afterwards.
Available since: | 2.6 |
Instance methods
webkit_user_content_manager_add_filter
Adds a WebKitUserContentFilter
to the given WebKitUserContentManager
.
The same WebKitUserContentFilter
can be reused with multiple
WebKitUserContentManager
instances.
Available since: 2.24
webkit_user_content_manager_add_script
Adds a WebKitUserScript
to the given WebKitUserContentManager
.
The same WebKitUserScript
can be reused with multiple
WebKitUserContentManager
instances.
Available since: 2.6
webkit_user_content_manager_add_style_sheet
Adds a WebKitUserStyleSheet
to the given WebKitUserContentManager
.
The same WebKitUserStyleSheet
can be reused with multiple
WebKitUserContentManager
instances.
Available since: 2.6
webkit_user_content_manager_register_script_message_handler
Registers a new user script message handler. After it is registered,
scripts can use window.webkit.messageHandlers.<name>.postMessage(value)
to send messages. Those messages are received by connecting handlers
to the WebKitUserContentManager::script-message-received
signal. The
handler name is used as the detail of the signal. To avoid race
conditions between registering the handler name, and starting to
receive the signals, it is recommended to connect to the signal
before registering the handler name:
Available since: 2.8
webkit_user_content_manager_register_script_message_handler_in_world
Registers a new user script message handler in script world with name world_name
.
See webkit_user_content_manager_register_script_message_handler()
for full description.
Available since: 2.22
webkit_user_content_manager_remove_all_filters
Removes all content filters from the given WebKitUserContentManager
.
Available since: 2.24
webkit_user_content_manager_remove_all_scripts
Removes all user scripts from the given WebKitUserContentManager
.
Available since: 2.6
webkit_user_content_manager_remove_all_style_sheets
Removes all user style sheets from the given WebKitUserContentManager
.
Available since: 2.6
webkit_user_content_manager_remove_filter
Removes a filter from the given WebKitUserContentManager
.
webkit_user_content_manager_remove_filter_by_id
Removes a filter from the given WebKitUserContentManager
given the
identifier of a WebKitUserContentFilter
as returned by webkit_user_content_filter_get_identifier().
Available since: 2.26
webkit_user_content_manager_remove_script
Removes a WebKitUserScript
from the given WebKitUserContentManager
.
Available since: 2.32
webkit_user_content_manager_remove_style_sheet
Removes a WebKitUserStyleSheet
from the given WebKitUserContentManager
.
Available since: 2.32
webkit_user_content_manager_unregister_script_message_handler
Unregisters a previously registered message handler.
Available since: 2.8
webkit_user_content_manager_unregister_script_message_handler_in_world
Unregisters a previously registered message handler in script world with name world_name
.
Available since: 2.22
Signals
WebKit2.UserContentManager::script-message-received
This signal is emitted when JavaScript in a web view calls
window.webkit.messageHandlers.<name>.postMessage()
, after registering
<name>
using
webkit_user_content_manager_register_script_message_handler()
Available since: 2.8
Signals inherited from GObject (1)
GObject.Object::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct WebKit2UserContentManagerClass {
GObjectClass parent_class;
void (* _webkit_reserved0) (
void
);
void (* _webkit_reserved1) (
void
);
void (* _webkit_reserved2) (
void
);
void (* _webkit_reserved3) (
void
);
}
Class members
parent_class |
|
No description available. | |
_webkit_reserved0 |
|
No description available. | |
_webkit_reserved1 |
|
No description available. | |
_webkit_reserved2 |
|
No description available. | |
_webkit_reserved3 |
|
No description available. |