Problem description:background
An error was reported when writing the file, saying that Service Worker
the set is background
invalid.
Workaround (check) method:
- Check if
配置文件(manifest.json)
in is . The parameter setting in is only used in the version, and it is used in the v2 version .manifest_version
3
background
service_worker
后台页(background.js)
v3
"scripts": ["background.js"]
background.js
The file must be in the root directory. I have set the directory"service_worker": "js/background.js"
to cause an error, and the official website also has instructions.
Error:
Correct:
background.js
The problem of plug-in calling in the file will also report this error. Generally, this kind of error can扩展程序页面
be viewed directly in the error.
Basically, after checking the above three places, this problem can be solved.