Manifest v3: Release / Review process

148 weergaven
Naar het eerste ongelezen bericht

Dmytro Chumak

ongelezen,
15 sep 2022, 07:24:4015-09-2022
aan Chromium Extensions
Atm we luckily built our chrome extension including our bundles directly in the extension. However, we use a lot of components from the main app, which obviously have a ton of business logic that is tightly connected with the API. 

Any update on this means that we have to release both - chrome extension and API. In the case of chrome extension - that is not easy, because the review could take 3 days, which means some features are down until the update won't happen. I know you told us that external script is the best solution and this also could be a reason. However, we can’t use external scripts in manifest v3. Here the statement:

In Manifest V3, all of your extension’s logic must be included in the extension. You can no longer load and execute a remotely hosted file. A number of alternative approaches are available, depending on your use case and the reason for remote hosting. Here are approaches to consider:
...
Consider migrating application logic from the extension to a remote web service that your extension can call. (Essentially a form of message passing.) This provides you the ability to keep code private and change the code on demand while avoiding the extra overhead of resubmitting to the Chrome Web Store.

I am not really sure what they mean by this. 

I am also not sure if something like below would be a better approach in that case (bundle everything in one file file and just make fetch request like this (kind of an external script loading trick)):
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { $.get("http://127.0.0.1:8000/bundle.js", function(result) { chrome.tabs.executeScript(tabs[0].id, {code: result}); }, "text"); });

Would be great to hear your thoughts on this!

hrg...@gmail.com

ongelezen,
15 sep 2022, 20:40:3115-09-2022
aan Chromium Extensions, Dmytro Chumak
The chrome.tabs.executeScript() function doesn't exist in Manifest V3. You have to use chrome.scripting.executeScript() which cannot execute a string of code.
You have two choices if you want to change or fix your extension's logic without going through a new review process.
  1. Parameterize as much as possible the part of the code that needs frequent changes/tweaks/fixes and obtain those parameters as a JSON string from your server.
  2. Remove the code that needs frequent changes from your extension and put it in your server. Then, from your extension you can make calls to your server to execute the necessary code and get the results you need.

Method #2 is what they mean by "Consider migrating application logic from the extension to a remote web service".

Of course, this assumes you have a server to begin with. If you don't have one, then you have no choice whatsoever.

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten