How to append query parameters to an URL using Chrome Extension’s declarativeNetRequest API

I want to develop a chrome extension that allows to append a query parameter to a specific URL (i.e. from www.google.com to www.google.com?q=query).

In Manifest v2 it was possible to accomplish it by using the webRequest API, but in Manifest v3 the API has been replaced by declarativeNetRequest. How is it possible to replicate the Manifest v2 solution in v3 through the declarativeNetRequest?

The ideal scenario would be even the possibility to specify the website domain through an input field in an extension’s popup.

Thanks