I'm looking at the doc for
declarativeNetRequest and I can not find any info on how to dynamically update the URL parameters, or the HTTP request parameters of a request.
The use case of my extensions is the following:
- Let a website know that the user has an extension installed by adding an extra HTTP header x-extensions-installed in the request. WebRequest is able to catch the request, add the extra parameter and let it continue. Example: if we promote our extension on our website, we don't want to show the promotion to a user who already has the extension installed, so up to now we were using this method to do it.
- Dynamic Search engine parameters in manifest.json: unfortunately the search engine has no dynamic parameter approach. The search engine URL is hardcoded in the URL. Let's say that I want my extension to change the search engine and I need to differentiate 2 types of promotions. For example I would want one to be
asearchengine.com?p={searchTerm}&origin=A and
asearchengine.com?p={searchTerm}&origin=B to identify those 2 promotions.
1 way would be to create 2 extensions on the chrome store. Easy. But it doesn't scale up and gets messy if you may want 100+ extensions.
So WebRequest was able to catch the request on the fly and add the parameter &origin={origin}.
Can this be done with declarativeNetRequest?
Thanks,
Francois