Google chrome extension 如何使chrome扩展对任何主机都是活动的

Google chrome extension 如何使chrome扩展对任何主机都是活动的,google-chrome-extension,Google Chrome Extension,我正在使用以下代码,因为chrome扩展将针对特定主机处于活动状态 chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { chrome.declarativeContent.onPageChanged.addRules([{ conditions: [new chrome.declarativeContent.PageStateMatcher({ pageUrl: {hostEquals

我正在使用以下代码,因为chrome扩展将针对特定主机处于活动状态

chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([{
  conditions: [new chrome.declarativeContent.PageStateMatcher({
    pageUrl: {hostEquals: 'www.google.com'},
  })],
  actions: [new chrome.declarativeContent.Sho``wPageAction()]
}]);
}))


我希望它对所有主机都是活动的。

您可以使用
hostContains:'。
为所有主机激活扩展。我已经对此进行了测试,它适用于所有主机。

您可以使用
urlContains:':'
,请参阅。@wOxxOm谢谢你,伙计:)