I have updated my extension from manifest v2 to V3 and Upload the latest manifest V3 extension to web store.
I have debugged the my extension in my local env. Everything is ok. But When I install the extension from web store. The extension can be installed as expected. But when I choose Off then On. The extension will pop up the error:"This extension may have been corrupted", needs to be repaired. Which cause my extension can not work now.
I have used the Fetch API to get my local data.json file(the file will be created by my local application and wrote in the extension path, the file is same directory with manifest file and background.js file) just like below:
From V2
chrome.runtime.getPackageDirectoryEntry(function(dirEntry) {
dirEntry.getFile("test.json", {}, function(fileEntry) {
console.log("Read \"data.json\" successfully");
fileEntry.file(function(fi) {
to V3:
fetch('test.json')
.then(response => response.json())
.then(json => {
console.log("Read \"data.json\" successfully");
I find that If the test.json is not created, the extension will be ok. After I create the data.json in the same directory with manifest and background.js, the extension will think that this extension may have been corrupted. But in my local debugging test, all things are ok.