Intercept HTTP request body from chrome extension

前端 未结 3 1133
清酒与你
清酒与你 2020-12-08 21:36

I\'m aware that chrome.webRequest.onBeforeRequest allows a request to be intercepted, analyzed and blocked, but it only allows access to the request headers, an

3条回答
  •  暖寄归人
    2020-12-08 21:53

    This functionality has been added to the API now, see the documentation.

    In order to access the body you need to do the following:

    chrome.webRequest.onBeforeRequest.addListener(
        function(details)
        {
            console.log(details.requestBody);
        },
        {urls: ["https://myurlhere.com/*"]},
        ['requestBody']
    );
    

提交回复
热议问题