Skip to content

Chrome 扩展程序开发

导入 ESM

js
const src = chrome.runtime.getURL('xxx.js')
const contentMain = await import(src)

manifest.json需要增加以下配置:

json
{
  "web_accessible_resources": [
    {
      "matches": ["<all_urls>"],
      "resources": ["src/xxx.js"]
    }
  ]
}

参考资料

Released under the MIT License.