简体   繁体   中英

Add-on not listed in Android AMO site, but listed under Windows platform

Our developer submitted a WebExtension add-on to AMO a while ago, which is publicly available. I could find it using search on Firefox Add-ons page . I tried to install the add-on on my mobile Firefox browser. I searched in the add-ons store, but it is not available. It appears that Firefox for Android goes to Android Add-ons page . I searched the same Android add-ons page from desktop, but the extension could not be found. I was told that the add-on was submitted last time with the "All Platforms" option selected. I could not find any documentation specific to submitting add-ons to the Android add-ons page. Are they different? Could it be a mistake during submitting the add-on? Or, is it because of the manifest file?

Here are the sections in the manifest.json file:

{
    "manifest_version": 2,
    "name": "Extension Name",
    "short_name": "EXTNSHORTN",
    "version": "0.0.1",

    "description": "some description",
    "icons": {
        "19": "images/icon19.png",
        "38": "images/icon38.png",
        "128": "images/icon.png"
    },

    "applications": {
        "gecko": {
            "id": "abc@def.com",
            "strict_min_version": "48.0"
        }
    },

    "background": {
        "scripts": [
            "a.js", "b.js", "c.js", "d.js", "e.js", "f.js", "g.js", "h.js",
            "background.js"
        ]
    },

    "permissions": [
        "alarms",
        "idle",
        "tabs",
        "activeTab",
        "<all_urls>",
        "notifications"
    ],
    "browser_action": {
        "browser_style": false,
        "default_icon": "images/icon.png",
        "default_title": "same title",
        "default_popup": "popup1.html"
    },
    "content_scripts": [
        {
            "matches": ["https://www.exmple.com/*"],
            "js": ["p.js"]
        }
    ],
    "web_accessible_resources": [
        "web_accessible/*"
    ]
}

The extension name is Engrip Extension. How do we fix this so the same extension is available both for Firefox on desktop and Firefox for Android?

WebExtension manifest.json files do not have any method to explicitly specify which applications they are compatible with. This is information which should be specified when the add-on is uploaded to AMO. The confusion is probably that "Firefox for Android" is considered a different "Application", not a "Platform". In this context, applications are the programs into which your add-on can be loaded. For example: "Firefox", "Firefox for Android", "Thunderbird", etc. Platforms are specifically "Linux", "Mac OS X", and "Windows". Yes, Android is actually a platform, but this is just the way it is organized.

Fortunately, you can change the supported applications for the current version from the AMO control panel for your add-on.

  • From the main developer console page for your add-on select "Manage Status & Versions" (in a blue box on the left, just above a separator line). The direct URL should be this
  • Under "Listed versions"➞"Currently on AMO" select the most recent version. This should be "Version 0.10.9".
  • On that page under "Manage Version xxx"➞"Compatibility" select "Add Another Application…"
  • Select "Firefox for Android" and complete which versions you are compatible with.
  • Save your changes.

It will look something like:

添加兼容的应用程序

Firefox for Android has an additional requirement for your manifest.json : a gecko section with an id must be set under browser_specific_settings according to Mozilla's Extension Workshop ("When do you need an add-on ID? ... Using Firefox for Android.") This is also mentioned on their Android checklist . The extra setting used to be required on the desktop before Firefox 48, is still required on Android, and creates a warning on Chrome so you might want to build a different version without it if you're also publishing to Chrome. Somewhat unhelpfully, without this id AMO still lets you declare that your extension is Android-compatible, but fails to list it and doesn't point out that the reason for its listing failure is your manifest's lack of browser-specific id.

As you have already published your extension without an ID, an ID will have been given you automatically, and you'd better not change it or else you will be publishing a new extension that is different from the first. So you need to find out what ID you have been given. You can do this by installing your extension into desktop Firefox from addons.mozilla.org, go to about:debugging , click "This Firefox", and under "Extensions" look for your extension's "Extension ID". That is what you'll need to add quotes around and put into the right part of your manifest to make it work for Android:

"browser_specific_settings": {
  "gecko": {
    "id": "{long-uuid-goes-here}"
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM