Saranraj K
Saranraj K

Reputation: 83

how to make the chrome extension is to be active for any host

I'm using the following code for the chrome extension is to be active for a particular host.

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()]
}]);

});

I want it to be active for all the hosts.

Upvotes: 3

Views: 1233

Answers (1)

Kaushal28
Kaushal28

Reputation: 5557

You can use hostContains: '.' which activates your extension for all hosts. I've tested this and it's working for all hosts.

Upvotes: 8

Related Questions