使用FF WebExtension,我试图从我不拥有的网站克隆一个元素。这是我使用的(取自W3C)。
// Get the last <li> element ("Milk") of <ul> with id="myList2"
var itm = document.getElementById("myList2").lastChild;
// Copy the <li> element and its child nodes
var cln = itm.cloneNode(true);
// Append the cloned <li> element to <ul> with id="myList1"
document.getElementById("myList1").appendChild(cln);
但是,出现此错误:
错误:访问属性“target”的权限被拒绝
这是我的清单:
{
"manifest_version": 2,
"name": "w",
"version": "0.1",
"description": "w",
"icons": {
"48": "icons/border-48.png"
},
"content_scripts": [
{
"matches": ["http://localhost/*"],
"js": ["rh-addbutton.js","rh-addpage.js"]
}
],
"permissions": ["http://localhost/*"]
}
我错过了许可吗?我无法在MDN上找到合适的许可。