Looking to retrieve POST data using a Webextensions API on page load.
Implemented a background script with the code below:
browser.webRequest.onBeforeSendHeaders.addListener(
getPostData,
{ urls: ['<all_urls>'], types: ["main_frame"] },
['blocking', 'requestHeaders']
);
function getPostData( e )
{
for( var header of e.requestHeaders )
{
console.log( header.name + ' = ' + header.value );
}
}
Encountering an issue where headers received do not contain POST data:
https://i.stack.imgur.com/y6Djd.png
Any suggestions on how to access the POST data through the WebExtensions API?