我正在开发一个仅在特定域中有效的扩展页面操作,我可以添加多个链接到页面操作?我的background.js就是这个.
可以在background.html中为扩展页面操作添加更多链接吗?
//background.js
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlContains: 'www.exemple.com' },
})
],
actions: [ new chrome.declarativeContent.ShowPageAction() ]
}
]);
Run Code Online (Sandbox Code Playgroud)