我想使用find.find() docs和find.highlightResults docs对firefox v 61进行扩展。按照建议,我在manifest.json的权限部分中添加了find,并且尝试了在highlightResults上找到的示例脚本,但该脚本似乎没有运行。
{
"manifest_version": 2,
"name": "find words",
"version": "1.0",
"description": "highlights words found on random website",
"icons": {
"48": "icons/border-48.png"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["test.js"]
}
],
"permissions": [
"webNavigation",
"webRequest",
"find"
]
}
和test.js的代码位看起来像这样:
function found(results) {
console.log(`There were: ${results.count} matches.`);
if (results.count > 0) {
browser.find.highlightResults();
}
}
browser.find.find("banana").then(found);
我想念什么?