webkit.user_content_manager

Module for [UserContentManager] class

Types 3

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.UserContentManager.addStyleSheet].

To use a #WebKitUserContentManager, it must be created using [webkit.user_content_manager.UserContentManager.new_], and then used to construct a #WebKitWebView. User style sheets can be created with [webkit.user_style_sheet.UserStyleSheet.new_].

User style sheets can be added and removed at any time, but they will affect the web pages loaded afterwards.

Methods
GType _gType() @property
UserContentManager self()Returns `this`, for use in `with` statements.
UserContentManagerGidBuilder builder()Get builder for [webkit.usercontentmanager.UserContentManager] Returns: New builder object
void addFilter(webkit.user_content_filter.UserContentFilter filter)Adds a #WebKitUserContentFilter to the given #WebKitUserContentManager.
void addScript(webkit.user_script.UserScript script)Adds a #WebKitUserScript to the given #WebKitUserContentManager.
void addStyleSheet(webkit.user_style_sheet.UserStyleSheet stylesheet)Adds a #WebKitUserStyleSheet to the given #WebKitUserContentManager.
bool registerScriptMessageHandler(string name, string worldName = null)Registers a new user script message handler in script world.
bool registerScriptMessageHandlerWithReply(string name, string worldName = null)Registers a new user script message handler in script world with name world_name.
void removeAllFilters()Removes all content filters from the given #WebKitUserContentManager.
void removeAllScripts()Removes all user scripts from the given #WebKitUserContentManager
void removeAllStyleSheets()Removes all user style sheets from the given #WebKitUserContentManager.
void removeFilter(webkit.user_content_filter.UserContentFilter filter)Removes a filter from the given #WebKitUserContentManager.
void removeFilterById(string filterId)Removes a filter by the given identifier.
void removeScript(webkit.user_script.UserScript script)Removes a #WebKitUserScript from the given #WebKitUserContentManager.
void removeStyleSheet(webkit.user_style_sheet.UserStyleSheet stylesheet)Removes a #WebKitUserStyleSheet from the given #WebKitUserContentManager.
void unregisterScriptMessageHandler(string name, string worldName = null)Unregisters a previously registered message handler in script world with name worldname. If null is passed as the worldname, the default world will be used.
gulong connectScriptMessageReceived(T)(string detail = null, T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : javascriptcore.value.Value))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : webkit.user_content_manager.UserContentManager))) && Parameters!T.length < 3)Connect to `ScriptMessageReceived` signal.
gulong connectScriptMessageWithReplyReceived(T)(string detail = null, T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : javascriptcore.value.Value))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == webkit.script_message_reply.ScriptMessageReply))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : webkit.user_content_manager.UserContentManager))) && Parameters!T.length < 4)Connect to `ScriptMessageWithReplyReceived` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new user content manager. Returns: A #WebKitUserContentManager

Fluent builder for [webkit.user_content_manager.UserContentManager]