1

That question is related to my previous "post". We get an Chrome Extension that inject an upload button inside the page of the client.

We inject jquery upload to upload file when the user choose them. Now with the latest update from Google, we are not more able to CROSS side call to our server. We need to do it in the background.js.

But how can we inject a "upload file" inside the content.js and execute the upload into the "background.js" ?

Just for more explication, we do not need to upload file into popop.js like this post suggest. We need to contextualized the "upload" file button in a page.

What workaround could be used ?

Cédric Boivin
  • 10,854
  • 13
  • 57
  • 98
  • Use FileReader API to read the file as text, transfer to the popup, which will construct a new FormData object, add a new item as a Blob and specify its file name, upload the form data object using fetch. Or you can do everything manually using MIME-encoding and XHR. There should be examples of doing everything mentioned above, hopefully. – wOxxOm Mar 15 '19 at 04:38
  • Yeah, that not simple. Finally i do not have choice to put a button in my content page, that will open a new "popup" window.open raise by the background.js, and then request a click from the user to click on the upload button, to select file, and send it to the server. That implementation add one more click to our customer ... but it's the best way we found. – Cédric Boivin Mar 15 '19 at 12:08

0 Answers0