1

I wanted to start to make an edge extension. I downloaded the official samples from github. Okaay.... I couldn't add it to edge because I got error: "The 'manifest_version' key must be present and set to 2 (without quotes)." I added it. But the samples are not working. I can add it to edge now, I feel I have problem with manifest or the content js script, because I tried to create an own from zero, but content.js not works. The background js run once when I add the extension. I tried to send a message from background.js to content.js, but nothing happened... I tried to add alert to content.js, where I listen the message and I tried to add an alert here without any magic. But nothing... Edge doesn't show errors in the console. Thanks in advance. :)

Here is the manifest:

{
    "name": "Quick Print",
    "version": "1.0.0.0",
    "author": "Microsoft",

    "manifest_version": 2,

    "icons": {
        "24": "icon_24.png",
        "48": "icon_48.png"
    },

    "permissions": [
        "tabs",
        "https://facebook.com/*"
    ],

    "browser_action": {
        "default_icon": {
            "20": "icon_20.png",
            "40": "icon_40.png"
        },
        "default_title": "Print!"
    },

    "background": {
        "scripts": ["background.js"],
        "persistent": false
    },

    "content_scripts": [{
        "matches": ["https://facebook.com/*"],
        "js": ["content.js"]
    }]
}
  • Which version of Microsoft Edge are you using? Where you download the edge extension? I have download the Edge Extension from the [official document](https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/getting-started/part2-content-scripts), and tried to install it in Microsoft Edge Version 83.0.478.45 (Official build) (64-bit). It seems that everything works well. Please check it. – Zhi Lv Jun 15 '20 at 06:11

1 Answers1

1

Perhaps you are using the latest version Microsoft Edge browser (Chromium based), but the extension is for the legacy version Microsoft Edge. In this scenario, it will show the "The 'manifest_version' key must be present and set to 2 (without quotes)" error.

enter image description here

To create a Microsoft Edge (Chromium) Extensions, you could check this tutorial:

Getting Started With Microsoft Edge (Chromium) Extensions

And, you could download the official simple extension sample by click the "Completed Extension Package Source for This Part" hyperlink in this link.

Zhi Lv
  • 18,845
  • 1
  • 19
  • 30