MicrosoftEdge-Extensions icon indicating copy to clipboard operation
MicrosoftEdge-Extensions copied to clipboard

[Bug - Partner Center] Certification fails for MV3 extension having both background.service_worker and background.script defined in manifest

Open StigNygaard opened this issue 1 year ago • 7 comments

The issue

Google/Chrome, Mozilla/Firefox and Apple/Safari all allow MV3 webextensions defining both background.service_worker and background.script in the manifest. In such cases browser will use only one of them and prefer the service_worker if the browser supports it. As documented here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support

While making the latest version of my Flickr Fixr webextension, I didn't even consider there could be a problem when uploading to MS Partner Center. I have tested the extension by manually installing in Edge, and it works perfect.

However when I upload to Partner Center, I get "package failed certification" error:

The following checks failed: Package acceptance validation error: The background.scripts field cannot be used with manifest version 3. Use the background.service_worker field instead. Error code: background: { "scripts": [ "background/flickr_fixr.js" ], "service_worker": "background/flickr_fixr.js", "type": "module" } Line: 38 Column: 17

To Reproduce

I'm guessing issue can be reproduced by uploading any MV3 webextension having both background.service_worker and background.script defined in the manifest.

Expected behavior

I had hoped/assumed it would accept the extension. Maybe with a warning, but not an error stopping me from publishing it.

Screenshots

Edge-backgroundscript-error-cropped

Desktop

Probably not relevant, but I logged into Partner Center using Firefox 128 on Windows 11.

Additional context

https://discourse.mozilla.org/t/mv3-background-scripts-vs-serviceworkers-ms-edge-didnt-get-the-memo/133613 https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/ https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support https://github.com/StigNygaard/Stigs_Flickr_Fixr https://github.com/StigNygaard/Stigs_Flickr_Fixr/blob/master/WebExtension/manifest.json Current Flickr Fixr available for Edge: https://microsoftedge.microsoft.com/addons/detail/ieinimkepkfmmpeakdgnoikimokffneh

StigNygaard avatar Jul 15 '24 18:07 StigNygaard

Okay, I see I'm not the first one reporting this: https://github.com/microsoft/MicrosoftEdge-Extensions/issues/136 https://github.com/microsoft/MicrosoftEdge-Extensions/issues/165

StigNygaard avatar Jul 15 '24 21:07 StigNygaard

Hi @StigNygaard, we want to express our gratitude for your understanding and patience. Please be assured that the similar feedback has already been forwarded to our engineering team, and they are diligently working on it. Your patience during this process is greatly appreciated.

We understand the importance of this issue and once we have an update or need further information, we will get back to you promptly. We appreciate your contribution to improving the platform.

ManikanthMSFT avatar Jul 16 '24 05:07 ManikanthMSFT

Bonus question/comment. A bit off-topic. But only a bit, it is still about cross-browser flexibility in manifest file and what Partner Center will allow me to upload...

I have another extension which requests the two related permissions "menus" and "contextMenus". Safari recognize "menus" as an alias for "contextMenus" and in Firefox "menus" represents a superset of "contextMenus" adding support for finding the exact DOM-element a context-menu was opened from. I don't think Chromium browsers recognize the "menus" permission(?), but I can still manually install and use the extension of mine in Chromium browsers.

My extension takes advantage of the extra feature (in Firefox) of "menus" when available, but also works without the extra feature. I use it by eventually redefining contextMenus like this:

globalThis.browser ??= chrome;
if (browser.menus?.getTargetElement) {
  browser.contextMenus = browser.menus;
}

So the question is, would Partner Center accept a manifest defining permissions something like this (with both "menus" and "contextMenus"):

  "permissions": [
    "scripting",
    "contextMenus",
    "menus",
    "storage"
  ],

I can install the extension manually in Edge. It works fine.

Maybe I should just try it, but there's some more work I want to do on extension and especially documentation (introduction) before eventually making it "officially" available for Chromium browsers.

StigNygaard avatar Jul 20 '24 09:07 StigNygaard

Hey @StigNygaard, thank you for providing additional information. We will respond with an update once we hear back from our team. We appreciate your patience in the meantime.

ManikanthMSFT avatar Jul 22 '24 07:07 ManikanthMSFT

It sounds like Microsoft plans to fix this(?). But are there any "ETA"?

StigNygaard avatar Sep 14 '24 12:09 StigNygaard

So I made a special Edge-version of my extension (currently in queue for review), to bring current version and features up to same level as available for Firefox and Chrome. However I strongly hope this issue will be fixed in Partner Center, so I don't need the extra trouble in the future.

No words of when it (hopefully) can be expected top be fixed in Partner Store?

StigNygaard avatar Oct 25 '24 11:10 StigNygaard

Hey @StigNygaard, we wanted to inform you that the feature you inquired about is currently on our backlog. We will update you once we have an update on this feature.

We appreciate your understanding and patience.

ManikanthMSFT avatar Dec 20 '24 05:12 ManikanthMSFT

Hi @StigNygaard

I am Rahul from the Microsoft Edge Extensions Developer Support team.

This feature request aligns with item #136, so I’m closing this as a duplicate. All future updates related to this feature will be tracked under #136. Thank you for your understanding.

Rahul-Bauri avatar Aug 11 '25 04:08 Rahul-Bauri