Class GeckoSession.PermissionDelegate.ContentPermission

Enclosing interface:

public static class GeckoSession.PermissionDelegate.ContentPermission extends Object
Represents a content permission -- including the type of permission, the present value of the permission, the URL the permission pertains to, and other information.
  • Field Details


      public static final int VALUE_PROMPT
      The corresponding permission is currently set to default/prompt behavior.
      See Also:

      public static final int VALUE_DENY
      The corresponding permission is currently set to deny.
      See Also:

      public static final int VALUE_ALLOW
      The corresponding permission is currently set to allow.
      See Also:
    • uri

      @NonNull public final String uri
      The URI associated with this content permission.
    • thirdPartyOrigin

      @Nullable public final String thirdPartyOrigin
      The third party origin associated with the request; currently only used for storage access permission.
    • privateMode

      public final boolean privateMode
      A boolean indicating whether this content permission is associated with private browsing.
    • permission

      public final int permission
      The type of this permission; one of PERMISSION_*.
    • value

      public final int value
      The value of the permission; one of VALUE_.
    • contextId

      @Nullable public final String contextId
      The context ID associated with the permission if any.
      See Also:
  • Constructor Details

    • ContentPermission

      protected ContentPermission()
  • Method Details

    • fromJson

      @AnyThread @Nullable public static GeckoSession.PermissionDelegate.ContentPermission fromJson(@NonNull JSONObject perm)
      Converts a JSONObject to a ContentPermission -- should only be used on the output of toJson().
      perm - A JSONObject representing a ContentPermission, output by toJson().
      The corresponding ContentPermission.
    • toJson

      @AnyThread @NonNull public JSONObject toJson() throws JSONException
      Converts a ContentPermission to a JSONObject that can be converted back to a ContentPermission by fromJson(JSONObject).
      A JSONObject representing this ContentPermission. Modifying any of the fields may result in undefined behavior when converted back to a ContentPermission and used.
      JSONException - if the conversion fails for any reason.