Hi,
I have recently added another content script to my extension which needs to run in the MAIN world for the functionality i intend to build. I am using crxjs/vite-plugin to bundle the project and crxjs typically creates a loader file where It loads the content script using chrome.runtime.getURL API.
In this case, an error is being thrown stating the following :
TypeError: Cannot read properties of undefined (reading 'getURL')
So, I would like to understand whether chrome.runtime is not accessible to scripts loaded in the MAIN world?
For additional context, the script is loaded statically through the manifest file. The alternative solution I am considering is to inject script manually through the chrome.scripting API. Any help regarding this would be much appreciated.
Thanks,
Bala