0

I need to ask for *://*/* permission, but I don't know how to do this, because with .permissions.require() doesn't work.

Steps I followed:

  • Insert *://*/* as "optional_permissions" in the manifest

  • Use this code to try to ask for permission

    const permissionsToRequest = {
                    permissions: ["*://*/*"]
                }
    
                async function onResponse(response) {
                    if (response) {
                        //Granted
                        console.log("Granted");
                    } else {
                        //Refused
                        console.log("Refused");
                    }
                    return browser.permissions.getAll();
                }
    
                console.log("Yes");
                browser.permissions.request(permissionsToRequest).then(onResponse);

I tried to use also “origins” but nothing… doesn’t work anyway

MrMe
  • 59
  • 7

1 Answers1

0

The problem was the "permissions". As a user suggested, the answer is to use "origins" instead

MrMe
  • 59
  • 7