Custom_Buttons icon indicating copy to clipboard operation
Custom_Buttons copied to clipboard

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

Open Infocatcher opened this issue 5 years ago • 0 comments

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, {});

Infocatcher avatar Jan 05 '20 16:01 Infocatcher