Questions regarding FF implementations (file input behaviour, faviconUrl quality, host_permission reload)

I’m very keen to publish my extension, but I’m seeking some clarity on the following:

  • Do host_permissions (specifically ["<all_urls>"]) require reloading the extension on install in order to apply? (Or is that just in the debugging environment)
  • My extension’s popup includes a file picker. I’ve found that opening the file picker closes the popup. Is there any sort of work-around for this?
    • If there isn’t, that’s fine
  • What determines the image (quality) returned by tab.faviconUrl?
    • Specifically, I’ve found that sometimes the image is lower quality, sometimes higher (the site’s actual icon)
    • I assume this is from caching, which if the case, is there anyway to specify HQ or ensure it’s returned? (Or even check that it has been).
    • I think I found reloading a page (I think the page had been cached) yielded the HQ icon, but if possible, I’d like to avoid that

Lastly, I was just hoping for some guidance on version targetting/adoption -
Some APIs I’ll be using are quite recent, which makes targetting a broader base tricky.
But I’ve found that version adoption is quite significant and quick (page bottom), so should I expect that most users will be reasonably up-to-date (e.g. > last 10 versions)?

  • I try to aim for store-min-supported (109 for FF?), but I need some recent APIs
  • Also totally get it can be hard to answer, so any sort of general advice would be appreciated

Thanks!

I’ve found these two discussions around the File Picker (I did search before asking!), and it seems clear that it’s not possible for now.

In that case, is there any intention on changing/supporting this sort of thing (File picker without closing the popup)?

To add: It looks like there was some more discussion in bugzilla.
Judging by the last activity, I’d say it’s safe to assume it’ll stay like this for a while.

I will say though (selfishly at that), it’d be great to have this, since it matches other browsers, which adds some familiarity for users jumping ship (to FF)

I can answer only some questions:

  1. all_urls permission - I’m not sure I understand, but all permissions listed in the manifest file are granted upon installation, except for optional permissions

  2. file picker in popup is broken, the best you can do is add a vote for the bug:
    https://bugzilla.mozilla.org/show_bug.cgi?id=1378527
    And then using some of the mentioned workarounds (like adding a button saying “Reopen this window in new tab”, etc…)

  3. favicon quality - well, this is indeed an issue, more stable solution could be to use unofficial Google / Duck Duck Go favicon service, although you should make it clear for users that you are using such service (protect users privacy).
    Note that quality of these favicons is also pretty low, but at least it’s consistent (in google you can even specify resolution, but you can still get only upscaled one).
    Example code:

export function getFaviconURL(domain: string) {
  switch(OPTIONS.FAVICON_PROVIDER) {
    case FaviconProviders.Google:     return `https://www.google.com/s2/favicons?sz=32&domain_url=${domain}`;
    case FaviconProviders.DuckDuckGo: return `https://icons.duckduckgo.com/ip3/${domain}.ico`;
    // case FaviconProviders.Direct:     return `https://${domain}/favicon.ico`;
    default:                          return '';
  }
}
  1. regarding targetting Firefox version / API - it’s best to target latest ESR version (which is released once a year every October), so currently it’s Firefox ESR 128.
1 Like