Chrome扩展从Manifest v2迁移至v3时遭遇包加载错误求助
Manifest V2迁移至V3后第三方库加载错误求助
我开发的一款小型Chrome扩展原本基于Manifest V2运行正常,但由于V2已被弃用,需要更新至Manifest V3。迁移后尝试加载未打包扩展时,Chrome抛出与第三方库相关的错误,涉及lodash的debounce、get方法,以及cheerio、axios。我已遵循谷歌迁移指南将后台脚本改为service_worker,且service_worker符合单文件要求、未操作DOM,但问题仍未解决,恳请提供技术指点。
Manifest V2 配置
{ "name": "LastBottle Price Checker", "version": "1.0.0", "description": "Fact-check the retail and web prices advertised on LastBottleWines.com by viewing crowd-sourced from consumers.", "manifest_version": 2, "icons": { "128": "icon128.png" }, "permissions": ["*://www.vivino.com/*", "*://api.vivino.com/", "unlimitedStorage", "activeTab"], "content_scripts": [ { "matches": ["https://www.lastbottlewines.com/*"], "js": ["contentScript.js"] } ], "background": { "scripts": ["bgScript.js"], "persistent": false } }
Manifest V3 配置
{ "name": "LastBottle Assistant", "version": "1.0.0", "description": "Fact-check the retail and web prices advertised on LastBottleWines.com by viewing crowd-sourced from consumers.", "manifest_version": 3, "icons": { "128": "icon128.png" }, "permissions": ["unlimitedStorage", "activeTab"], "host_permissions": ["*://www.vivino.com/*","*://api.vivino.com/"], "content_scripts": [ { "matches": ["https://www.lastbottlewines.com/*"], "js": ["contentScript.js"] } ], "minimum_chrome_version": "93", "background": { "service_worker": "bgScript.js", "type": "module" } }
Chrome加载错误截图
第一条消息似乎由第二条导致:


内容的提问来源于stack exchange,提问作者Botlanta
相关产品推荐
相关产品推荐

