Grab file from chrome webRequest onBeforeRequest -
i trying fetch files want uploaded via post. unfortunately requestbody formdata giving me huge headaches accessing file. filename string.... have file contents blob or data-url...
//in form on page <input type="file" name="files[]" multiple> //extension's background.js chrome.webrequest.onbeforerequest.addlistener( function(details) { console.log(details); n = "files[]"; var file = details.requestbody.formdata[n][0]; console.log(file ); // babygnutux-big.jpg console.log(typeof file); // string }, {urls: ["*://example.de/*"]}, ["blocking", "requestbody"]);
Comments
Post a Comment