2

I have used the "Microsoft Edge Extension Toolkit" (https://www.microsoft.com/en-us/store/p/microsoft-edge-extension-toolkit/9nblggh4txvb) to convert the chrome extension code to be compatible with MS Edge browser.

Enabled the "Developer Settings" from "about:flags" and loaded the newly converted code.

Everything works well except the icon in the toolbar. Its a "browserAction" (https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/api-support/supported-APIs/) button .

It is showing the default icon by the browser even after trying out a lot of icons but no luck.

Does anyone have any idea about any option though which the icon can be set or the image type required.

Tried installing other extensions and their icon is clearly visible.

Any ideas?

Edit:

Here is the manifest.json file content: The contents are not changed after conversion.

{
    "manifest_version": 2,
    "name": "............",
    "description": "............",
    "version": "1.0",
    "author": "............",
    "browser_action": {
        "default_icon": {
            "16": "data/images/icon-16.png",
            "32": "data/images/icon-32.png",
            "48": "data/images/icon-48.png",
            "64": "data/images/icon-64.png",
            "128": "data/images/icon-128.png"
        },
        "default_title": "............"
    },
    "icons": {
        "16": "data/images/icon-16.png",
        "32": "data/images/icon-32.png",
        "48": "data/images/icon-48.png",
        "64": "data/images/icon-64.png",
        "128": "data/images/icon-128.png"
    },
    "background": {
        "scripts":[
            "background.js"
        ],
        "persistent": false
    },
    "content_scripts": [
        {
            "run_at": "document_end",
            "matches": ["http://*/*", "https://*/*"],
            "css": [
                "data/css/style.css"
            ],
            "js": [
                "data/js/script.js"
            ]
        }
    ],
    "permissions": [
        "tabs",
        "activeTab",
        "contextMenus",
        "http://*/*",
        "https://*/*"
    ],
    "web_accessible_resources": [
        "data/images/icon-16.png",
        "data/images/icon-32.png",
        "data/images/icon-48.png",
        "data/images/icon-64.png",
        "data/images/icon-128.png"
    ]
}

To add more to this, the icons are properly scaled to the sizes mentioned in the file.

Kunal Dethe
  • 1,254
  • 1
  • 18
  • 38
  • 1
    A good start would be showing the relevant manifest entry before and after conversion. – Xan Oct 14 '16 at 15:20
  • Yes, that was my bad on not adding the manifest file contents. But have found the solution. – Kunal Dethe Oct 14 '16 at 15:53
  • @KunalDethe, Without your *manifest.json* contents this is a bad/(less useful) question, because it is impossible to answer without **guessing** at what the problem is. Officially, it is off-topic because it is a debugging question which does not include a [mcve]. If you update the question to include **at least** a *manifest.json* file which duplicates the problem, please leave a comment with `@Makyen` so I can remove my down-vote and retract my close-vote. – Makyen Oct 14 '16 at 17:14
  • @Makyen Yes, I have understood the importance of the data required in the question. But as I didn't think at the time of the asking the question about the manifest.json file, so I missed it. I have added the file content in the question now. Let me know if any more details are required. – Kunal Dethe Oct 15 '16 at 15:36

2 Answers2

1

I got lucky with a sample extension code that I found after a long time that actually worked.

The manifest.json file had this one setting:

"browser_action": {
    "default_icon": {
        "20": "data/images/icon-20.png"
    },
    "default_title": "................"
},

In other browsers the image size of 16, 24, 32, 48 and 128 works well but this particular browser requires a 20x20 size, surprisingly.

Hope this helps someone.

Kunal Dethe
  • 1,254
  • 1
  • 18
  • 38
  • 1
    That's unfortunate. Default behavior should be to scale the closest one, and the Toolkit should warn about it. You may want to report this to the bugtrackers. – Xan Oct 14 '16 at 16:17
1

browser_action Microsoft Edge does not support the following syntax: browser_action : {"default_icon" : "icon.png" } Size for icons must be specified. Preferred sizes: 20px, 25px, 30px, 40px. Other supported sizes: 19px, 35px, 38px.

Here's the documentation https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/api-support/supported-manifest-keys/

Ann Yu
  • 137
  • 1
  • 4