Firefox addon firefox扩展中的Web组件

Firefox addon firefox扩展中的Web组件,firefox-addon,web-component,content-script,Firefox Addon,Web Component,Content Script,我尝试在Firefox扩展中使用web组件,但在尝试添加所需的多边形填充以使web组件在Firefox上工作时,总是会出错 多填料使用 第一次尝试-webcomponents-sd-ce.js “内容脚本”:[ { “matches”:[“我使用的是chrome。chrome需要此polyfill,因为在上下文脚本窗口中没有“customElements”属性。这通常是用户窗口属性列表中的默认属性 第二次尝试-webcomponents-bundle.js “内容脚本”:[ { “匹配项”:[

我尝试在Firefox扩展中使用web组件,但在尝试添加所需的多边形填充以使web组件在Firefox上工作时,总是会出错

多填料使用

第一次尝试-webcomponents-sd-ce.js
“内容脚本”:[
{
“matches”:[“我使用的是chrome。chrome需要此polyfill,因为在上下文脚本窗口中没有“customElements”属性。这通常是用户窗口属性列表中的默认属性

第二次尝试-webcomponents-bundle.js
“内容脚本”:[
{
“匹配项”:[“”],
“js”:[“webcomponents bundle.js”,“contentScript.js”],
“运行时间”:“文档结束”
}
我得到的错误是

TypeError:“importNode”是只读webcomponents捆绑包。js:169:460


我通常不会对这些文件产生问题,因此我不知道问题的起因。如果是上下文窗口和正常窗口之间的问题,或者只是我如何使用它。

第一个解决方案对我有效。
 "content_scripts": [
{
  "matches":["<all_urls>"],
  "js": ["bundles/webcomponents-sd-ce.js", "contentScript.js"],
  "run_at": "document_end"
}
  "content_scripts": [
{
  "matches":["<all_urls>"],
  "js": ["webcomponents-bundle.js", "contentScript.js"],
  "run_at": "document_end"
}