I am trying to migrate my browser extension from MV2 to MV3. The purpose of this extension is to communicate with a Native Host to implement some automation controls.
In my content script, I have included jQuery and some helper functions. When I use userScript.execute() to run some dynamic code which use jQuery or the helper functions, I encounter an error saying "These methods cannot be found." After checking the documentation, I found that the ExecutionWorld for userScript can only be set to MAIN or USER_SCRIPT, and it does not support using the ISOLATED world as in content scripts.
I am facing the following choices:
Use USER_SCRIPT, and for each UserScript, insert the jQuery code and helper methods before the main code.
Use MAIN for both ContentScript and UserScript, which might cause conflicts.
Is there a better option? Would it be possible to allow userScript.execute() to run in the ISOLATED world?
Thank you! --
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/941d972f-bbd4-4632-85aa-06f0742e7aacn%40chromium.org.