Class WebsitePolicies

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class WebsitePolicies extends GObject

View specific website policies.

WebKitWebsitePolicies allows you to configure per-page policies, currently only autoplay policies are supported.

Since:
2.30
  • Constructor Details

    • WebsitePolicies

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

      public WebsitePolicies()
      Create a new WebsitePolicies.
  • Method Details

    • getType

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

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

      protected WebsitePolicies asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • withPolicies

      public static WebsitePolicies withPolicies(String firstPolicyName, Object... varargs)

      Create a new WebKitWebsitePolicies with given policies.

      Create a new WebKitWebsitePolicies with policies given as variadic arguments.

      Parameters:
      firstPolicyName - name of the first policy to set
      varargs - value of first policy, followed by more policies, null-terminated
      Returns:

      the newly created WebKitWebsitePolicies

      WebKitWebsitePolicies *default_website_policies = webkit_website_policies_new_with_policies(
          "autoplay", WEBKIT_AUTOPLAY_DENY,
          NULL);
      
      // ...
      
      WebKitWebView *view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
          "web-context", ctx,
          "settings", settings,
          "user-content-manager", content_manager,
          "website-policies", default_website_policies,
          NULL));
      
      // ...
      
      Since:
      2.30
    • getAutoplayPolicy

      public AutoplayPolicy getAutoplayPolicy()
      Get the WebKitWebsitePolicies:autoplay property.
      Returns:
      WebKitAutoplayPolicy
      Since:
      2.30
    • builder

      public static WebsitePolicies.Builder<? extends WebsitePolicies.Builder> builder()
      A WebsitePolicies.Builder object constructs a WebsitePolicies with the specified properties. Use the various set...() methods to set properties, and finish construction with WebsitePolicies.Builder.build().
      Returns:
      the builder object