Class SecurityManager

All Implemented Interfaces:
Proxy

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

Controls security settings in a WebKitWebContext.

The WebKitSecurityManager defines security settings for URI schemes in a WebKitWebContext. Get it from the context with webkit_web_context_get_security_manager(), and use it to register a URI scheme with a certain security level, or to check if it already has it.

  • Constructor Details

    • SecurityManager

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

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

    • getType

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

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

      protected SecurityManager 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
    • registerUriSchemeAsCorsEnabled

      public void registerUriSchemeAsCorsEnabled(String scheme)

      Register scheme as a CORS (Cross-origin resource sharing) enabled scheme.

      This means that CORS requests are allowed. See W3C CORS specification http://www.w3.org/TR/cors/.

      Parameters:
      scheme - a URI scheme
    • registerUriSchemeAsDisplayIsolated

      public void registerUriSchemeAsDisplayIsolated(String scheme)

      Register scheme as a display isolated scheme.

      This means that pages cannot display these URIs unless they are from the same scheme.

      Parameters:
      scheme - a URI scheme
    • registerUriSchemeAsEmptyDocument

      public void registerUriSchemeAsEmptyDocument(String scheme)

      Register scheme as an empty document scheme.

      This means that they are allowed to commit synchronously.

      Parameters:
      scheme - a URI scheme
    • registerUriSchemeAsLocal

      public void registerUriSchemeAsLocal(String scheme)

      Register scheme as a local scheme.

      This means that other non-local pages cannot link to or access URIs of this scheme.

      Parameters:
      scheme - a URI scheme
    • registerUriSchemeAsNoAccess

      public void registerUriSchemeAsNoAccess(String scheme)

      Register scheme as a no-access scheme.

      This means that pages loaded with this URI scheme cannot access pages loaded with any other URI scheme.

      Parameters:
      scheme - a URI scheme
    • registerUriSchemeAsSecure

      public void registerUriSchemeAsSecure(String scheme)

      Register scheme as a secure scheme.

      This means that mixed content warnings won't be generated for this scheme when included by an HTTPS page.

      Parameters:
      scheme - a URI scheme
    • uriSchemeIsCorsEnabled

      public boolean uriSchemeIsCorsEnabled(String scheme)

      Whether scheme is considered as a CORS enabled scheme.

      See also webkit_security_manager_register_uri_scheme_as_cors_enabled().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is a CORS enabled scheme or false otherwise.
    • uriSchemeIsDisplayIsolated

      public boolean uriSchemeIsDisplayIsolated(String scheme)

      Whether scheme is considered as a display isolated scheme.

      See also webkit_security_manager_register_uri_scheme_as_display_isolated().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is a display isolated scheme or false otherwise.
    • uriSchemeIsEmptyDocument

      public boolean uriSchemeIsEmptyDocument(String scheme)

      Whether scheme is considered as an empty document scheme.

      See also webkit_security_manager_register_uri_scheme_as_empty_document().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is an empty document scheme or false otherwise.
    • uriSchemeIsLocal

      public boolean uriSchemeIsLocal(String scheme)

      Whether scheme is considered as a local scheme.

      See also webkit_security_manager_register_uri_scheme_as_local().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is a local scheme or false otherwise.
    • uriSchemeIsNoAccess

      public boolean uriSchemeIsNoAccess(String scheme)

      Whether scheme is considered as a no-access scheme.

      See also webkit_security_manager_register_uri_scheme_as_no_access().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is a no-access scheme or false otherwise.
    • uriSchemeIsSecure

      public boolean uriSchemeIsSecure(String scheme)

      Whether scheme is considered as a secure scheme.

      See also webkit_security_manager_register_uri_scheme_as_secure().

      Parameters:
      scheme - a URI scheme
      Returns:
      true if scheme is a secure scheme or false otherwise.
    • builder

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