javascript - Regex in chrome.declarativeContent.PageStateMatcher -


i need add regex inside chrome.declarativecontent.pagestatematcher.

so far have

var matcher = new chrome.declarativecontent.pagestatematcher({     pageurl: {          urlcontains: "something.com/someregex/something"      }  }); 

essentially want have regular expression evaluate "something.com/4-5 char string/somithing".

how this? possible chrome.declarativecontent.pagestatematcher?

thanks

instead of urlcontains use urlmatches

this i'm using both domain fedmich.com , fedche.com

chrome.runtime.oninstalled.addlistener(function() {   chrome.declarativecontent.onpagechanged.removerules(undefined, function() {     chrome.declarativecontent.onpagechanged.addrules([       {         conditions: [           new chrome.declarativecontent.pagestatematcher({             pageurl: { urlmatches: '(fedmich|fedche)\.com' },           })         ],         actions: [ new chrome.declarativecontent.showpageaction() ]       }     ]);   }); }); 

documentation here https://developer.chrome.com/extensions/events#property-urlfilter-hostequals

the regular expressions use re2 syntax. https://code.google.com/p/re2/wiki/syntax


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -