Request permissions in Android not working

Currently i try to request optional_permissions for an Android Webextension, but there is no popup, asking the permission. There is also no error or warning on the console. It happens nothing. Im a little bit clueless, what i can do.

In manifest.json, i have the following definition:

"optional_permissions": [
        "https://*/*"
 ],

In my options page, i click on a button

chrome.permissions.request({
        origins: [customurl.protocol+'//'+customurl+'/*']
    }, function(granted){
        if(granted) {
            console.log("permission is granted");
        } else {
            console.log("permission is NOT granted");
        }
    });

I use the same Extension also on Desktop. There, i get a popup message, asking for permission, for the url in customurl. But in Android, i get nothing.

I’m not sure how trustworthy the compat data for permissions.request is, since it seems just copied from Firefox… (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/request#browser_compatibility)

I wonder if it’s even supported at all on Android.

According to this page, it should work on Android. I have tested the same with browser namespace, but i get the same behaviour. And yes, the options page is opening in its own tab. For me, this looks like a bug, but im not sure.

According to that page the caveats of the API are identical to desktop, which does not seem plausible to me. I suspect the data was just copied.

I found a bug report at https://github.com/mozilla-mobile/fenix/issues/16912, mention the same bug. It seems, i have to wait, that this will be solved.

2 Likes