Skip to content

[Cookies/Plugins Permissions] Doesn't work in Firefox 71+ due to removed URI-based APIs like nsIPermissionManager.testPermission() #48

@Infocatcher

Description

@Infocatcher

https://bugzilla.mozilla.org/show_bug.cgi?id=1402957
Remove permission manager APIs that only accept a URI

https://dxr.mozilla.org/mozilla-central/source/netwerk/base/nsIPermissionManager.idl

  /**
   * Test whether the principal has the permission to perform a given action.
   * System principals will always have permissions granted.
   * This function will perform a pref lookup to permissions.default.<type>
   * if the specific permission type is part of the whitelist for that functionality.
   */
  uint32_t testPermissionFromPrincipal(in nsIPrincipal principal,
                                       in ACString type);

Something from attached patches:

let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin("https://example.com");

let uri = Services.io.newURI("https://example.com", null, null);
let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions