Trying to migrate the Chrome extension from manifest v2 to v3 but running into some errors. The popup script appears to be working (home page pops up when I click the extension icon) but it seems to not see the background script at all.
When uploading the extension folder to the browser, I get these 2 errors:
Seems like the 2nd error is the cause of the 1st one but I'm not sure where it's getting this window
from. I removed everything that might refer to window
in the code but I'm still getting that error.
I might need to change some webpack settings but I'm not sure what exactly. So guys, if anyone had a similar issue or just tried to migrate extensions, please let me know if you have any ideas.
Here's my manifest file:
{
"manifest_version": 3,
"name": "__MSG_extName__",
"description": "__MSG_extDescription__",
"default_locale": "en",
"permissions": [
"tabs",
"storage",
"cookies"
],
"host_permissions": [
"<all_urls>"
],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"icons": {
"16": "icons/16.png",
"48": "icons/48.png",
"128": "icons/128.png"
},
"background": {
"service_worker": "js/background.js"
},
"action": {
"default_popup": "popup.html",
"default_title": "__MSG_extName__"
},
"web_accessible_resources": [
{
"resources": [
"icons/*.png",
"fonts/*",
"css/*"
],
"matches": [
"<all_urls>"
]
}
]
}
I used the vue-web-extension plugin to create the extension.
Will be happy to provide any additional details if needed.