Edge addon manifest config problems when publish

Nufinetes.dev 25 Reputation points
2024-01-17T15:14:32.87+00:00

I created an Extension based by chrome extension api, and it works fine with Edge browser in dev mode. Now I am publishing it to edge store But after I uploaded the package, some verification program told me that the setting of my manifest is not valid

Only the following properties are allowed in the object: 
matches, exclude_matches, css, js, match_about_blank, 
run_at, all_frames, include_globs, exclude_globs, 
permissions, content_security_policy. 
error code:content_scripts[1].world: MAIN

It is "content_scripts" part of my V3 manifest the whole settings is below

{
  "manifest_version": 3,
  "minimum_chrome_version": "111",
......
  "content_scripts": [
    {
      "js": [
        "content.bundle.js"
      ],
      "matches": [
        "<all_urls>"
      ],
      "run_at": "document_start",
      "all_frames": true
    },
    {
      "js": [
        "injected.js"
      ],
      "matches": [
        "<all_urls>"
      ],
      "world": "MAIN", // here is the error line
      "run_at": "document_start",
      "all_frames": true
    }
  ],
......
}

As you see, I added "world": "MAIN" in content_scripts settings which is a new property after chrome 111 version, should also be supported by edge Please help me to solve this issue, because without this config, my extension willl not work well

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,449 questions
0 comments No comments
{count} vote

Accepted answer
  1. Wenying Lu-MSFT 2,075 Reputation points Microsoft Vendor
    2024-01-18T09:52:52.7866667+00:00

    Hi @Nufinetes.dev , Can you successfully publish it to chrome store?
    Maybe that you received the error because of this warning.
    "world" - ISOLATED | MAIN
    Optional. The JavaScript world for a script to execute within. Choosing the "MAIN" world means the script will share the execution environment with the host page's JavaScript. See Work in isolated worlds to learn more.
    Warning: There are risks involved when using the "MAIN" world. The host page can access and interfere with the injected script. See Work in isolated worlds to learn more.

    ---If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. Best Regards, Wenying Lu


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.