9951 explained code solutions for 126 technologies


chrome-extensionLoad background script


{
  "name": "My",
  "manifest_version": 3,
  // ...
  "background": {
    "service_worker": "bg.js"
  },,
  // ...
}ctrl + c
"background"

specify script to load in background

"bg.js"

name of the background script to load (should be placed in the same folder as manifest.json)