Search code examples
javascriptgoogle-chrome-extension

Chrome url match patterns


I can't seem to get the "?" char to match a question mark in a url.

So essentially

"matches": [ "http://www.google.com/search?* ],

will not match

"http://www.google.com/search?cx=c&sourceid=chrome&ie=UTF-8&q=asdf"

Also,

"matches" : [ "http://www.google.com/search*asdf" ],

doesn't match

"http://www.google.com/search?aq=f&cx=c&sourceid=chrome&ie=UTF-8&q=asdf"

This has led me to believe that chrome doesn't consider anything after the "?". Is this right?


Solution

  • You need to take out the question mark, according to the docs:

    "matches": [ "http://www.google.com/search* ],
    

    That will match the request parameters as well.