I am trying to create a chrome extension that checks if a person is trying to upload image from a webpage, this image is copied and uploaded by chrome extension.
I am trying to achieve this using chrome.webRequest
- monitor the requests and try to find the image payload in base64. So far all of my efforts have failed.
The website I am playing with is using using plupload.Uploader
to upload images so I really don't have a choice to play with the DOM and see how it works.
Here is what I am trying to do with my code
chrome.webRequest.onBeforeRequest.addListener(function (details){
console.log(details)
}, {
urls: ["http://*/*", "https://*/*"],
types: [ "xmlhttprequest"]
},
["requestBody"])
And the website is sending POST requests whenever I upload an image (screenshot attached)
So my questions are 1. Is this approach of mine to monitor outgoing requests for payload OK? 2. Does extension support what I am trying to do in here?