Answers for "how to set multiple pageUrl for PageStateMatcher"

0

how to set multiple pageUrl for PageStateMatcher

chrome.runtime.onInstalled.addListener(function() {
    chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
        chrome.declarativeContent.onPageChanged.addRules([{
            conditions: [
                new chrome.declarativeContent.PageStateMatcher({
                    pageUrl: { hostSuffix: 'example.com' }
                }),
                new chrome.declarativeContent.PageStateMatcher({
                    pageUrl: { hostSuffix: 'example.net' }
                }),
            ],
            actions: [ new chrome.declarativeContent.ShowPageAction() ]
       }]);
    });
});
Posted by: Guest on September-08-2021

Code answers related to "how to set multiple pageUrl for PageStateMatcher"

Browse Popular Code Answers by Language