### Class

# WebKit UserContentManager

since: 2.6

#### Description [src]

    final class WebKit.UserContentManager : GObject.Object {
      /* No available fields */
    }

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 used to construct a `WebKitWebView`. 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

#### Ancestors

- GObject

#### Constructors

###### webkit_user_content_manager_new

Creates a new user content manager.

since: 2.6

#### Instance methods

###### webkit_user_content_manager_add_filter

Adds a `WebKitUserContentFilter` to the given `WebKitUserContentManager`.

since: 2.24

###### webkit_user_content_manager_add_script

Adds a `WebKitUserScript` to the given `WebKitUserContentManager`.

since: 2.6

###### webkit_user_content_manager_add_style_sheet

Adds a `WebKitUserStyleSheet` to the given `WebKitUserContentManager`.

since: 2.6

###### webkit_user_content_manager_register_script_message_handler

Registers a new user script message handler in script world.

since: 2.40

###### webkit_user_content_manager_register_script_message_handler_with_reply

Registers a new user script message handler in script world with name `world_name`.

since: 2.40

###### webkit_user_content_manager_remove_all_filters

Removes all content filters from the given `WebKitUserContentManager`.

since: 2.24

###### webkit_user_content_manager_remove_all_scripts

Removes all user scripts from the given `WebKitUserContentManager`.

since: 2.6

###### webkit_user_content_manager_remove_all_style_sheets

Removes all user style sheets from the given `WebKitUserContentManager`.

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 by the given identifier.

since: 2.26

###### webkit_user_content_manager_remove_script

Removes a `WebKitUserScript` from the given `WebKitUserContentManager`.

since: 2.32

###### webkit_user_content_manager_remove_style_sheet

Removes a `WebKitUserStyleSheet` from the given `WebKitUserContentManager`.

since: 2.32

###### webkit_user_content_manager_unregister_script_message_handler

Unregisters a previously registered message handler in script world with name `world_name`. If `NULL` is passed as the `world_name`, the default world will be used.

since: 2.40

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

###### WebKit.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()`

since: 2.8

###### WebKit.UserContentManager::script-message-with-reply-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_with_reply()`

since: 2.40

##### Signals inherited from GObject (1)

###### GObject::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 WebKitUserContentManagerClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.