The "background.persistent" key cannot be used with manifest_version 3. Use the "background.service_worker" key instead.
时间: 2024-05-24 19:11:28 浏览: 150
This error message is usually encountered when using a Chrome extension with a manifest file that has a manifest_version of 3. The "background.persistent" key is no longer supported in manifest version 3 and has been replaced by the "background.service_worker" key.
To resolve this issue, you should update your manifest file to replace the "background.persistent" key with the "background.service_worker" key. The "background.service_worker" key specifies the name of the service worker that will be used to run the background script.
Here is an example of how to update your manifest file:
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0",
"background": {
"service_worker": "background.js"
},
"permissions": [
"storage"
]
}
In this example, the "background.persistent" key has been replaced with the "background.service_worker" key, and the name of the service worker file is specified as "background.js".
阅读全文