Webextension - How do I make the browserAction popup work on Firefox Android

  • Is there any way that I can make it work?
  • Also what should I do if my extension needs to ask for additional permissions later on. It does not see to work on Android.
  • Is it possible to upload 2 version of the addon. One for mobile and more for desktop version of Firefox.

P.S. I tried on Firefox for Android 55.0.2

Is there any way that I can make it work?

More or less. This is what I do:

// browser_action (can not be set in manifest due to fennec incompatibility)
!fennec && browserAction.setIcon({ path: manifest.icons[1], });
!fennec && browserAction.setPopup({ popup: '/view.html#panel', });
fennec && browserAction.onClicked.addListener(async () => 
    tabs.create({ url: `/view.html?forTab=${
        (await tabs.query({ windowId, active: true, }))[0].id
    }#panel`, })
);

Is it possible to upload 2 version of the addon. One for mobile and more for desktop version of Firefox.

I think it is, but with the above approach, you don’t need to.

Also what should I do if my extension needs to ask for additional permissions later on. It does not see to work on Android.

It should. Please elaborate.

Thanks for helping out.

Regarding the additional permissions, my extension cant seem to ask for additional permission in Android. In desktop this works without any issue. Here is a link to the addon: https://addons.mozilla.org/en-US/firefox/addon/9anime-companion

https://github.com/lap00zza/9anime-Companion/blob/master/src/ts/dashboard.ts#L197-L230

Hm. I can’t see any obvious problems. Which API exactly are you using (browser/chrome, background page / visible extension page)? That shouldn’t but sometimes does make a difference if UI prompts are involved.

I am using chrome and background_page. Also would it be okay if I talk to you via irc/pm.

There isn’t really much more I can tell you. I think it would be worth a shot to use the chrome or browser object of an open visible page.