A
A
albertalexandrov2019-12-19 00:06:53
Google Chrome
albertalexandrov, 2019-12-19 00:06:53

Where to get query params when working with chrome.webRequest.onBeforeRequest?

Hello everyone!)
I'm working on an extension for Google Chrome. Hung a listener on onBeforeRequest :

chrome.webRequest.onBeforeRequest.addListener(
        function(details) {
            console.log(details);
        },
        {urls: ["<all_urls>"]},
        ["requestBody"]
)

I expected that with a get-request details.requestBodyI would get query parameters (those after ?). However, as it turned out, the data (form data) of post-requests is put there.
How to get query parameters?
P.S. In general, extracting parameters from the url is not a problem. I just thought maybe there's a built-in feature.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question