Class UserStyleSheet

java.lang.Object
org.javagi.base.ProxyInstance
org.webkitgtk.UserStyleSheet
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class UserStyleSheet extends ProxyInstance
A CSS style sheet which can be injected in loaded pages.
Since:
2.6
  • Constructor Details

    • UserStyleSheet

      public UserStyleSheet(MemorySegment address)
      Create a UserStyleSheet proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • UserStyleSheet

      public UserStyleSheet(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, @Nullable String @Nullable [] allowList, @Nullable String @Nullable [] blockList)

      Creates a new user style sheet.

      Style sheets can be applied to some URIs only by passing non-null values for allowList or blockList. Passing a null allow_list implies that all URIs are on the allow_list. The style sheet is applied if an URI matches the allow_list and not the block_list. URI patterns must be of the form [protocol]://[host]/[path], where the host and path components can contain the wildcard character (*) to represent zero or more other characters.

      Parameters:
      source - Source code of the user style sheet.
      injectedFrames - A WebKitUserContentInjectedFrames value
      level - A WebKitUserStyleLevel
      allowList - An allow_list of URI patterns or null
      blockList - A block_list of URI patterns or null
      Since:
      2.6
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the UserStyleSheet class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • forWorld

      public static UserStyleSheet forWorld(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, String worldName, @Nullable String @Nullable [] allowList, @Nullable String @Nullable [] blockList)

      Creates a new user style sheet for script world.

      Creates a new user style sheet for script world with name worldName. See webkit_user_style_sheet_new() for a full description.

      Parameters:
      source - Source code of the user style sheet.
      injectedFrames - A WebKitUserContentInjectedFrames value
      level - A WebKitUserStyleLevel
      worldName - the name of a WebKitScriptWorld
      allowList - An allow_list of URI patterns or null
      blockList - A block_list of URI patterns or null
      Returns:
      A new WebKitUserStyleSheet
      Since:
      2.22
    • ref

      public UserStyleSheet ref()

      Atomically increments the reference count of this UserStyleSheet by one.

      This function is MT-safe and may be called from any thread.

      Returns:
      The passed WebKitUserStyleSheet
      Since:
      2.6
    • unref

      public void unref()

      Atomically decrements the reference count of this UserStyleSheet by one.

      If the reference count drops to 0, all memory allocated by WebKitUserStyleSheet is released. This function is MT-safe and may be called from any thread.

      Since:
      2.6