0

I am trying to build a chrome extension that changes an image before a user uploads it in facebook.

I wanted to capture the image when the user selects it from the filebrowser and change it with my script then send the changed image. I cannot seem to find any api in chrome extension documentation that would listen for that file browse event when the input file button is clicked.

I know there is fileBrowserHandler but this only works on ChromeOS which is not what i am looking for. I have also looked into webRequest.onBeforeRequest but cannot seem to find any file that is being uploaded.

Has anyone tried something like this before? Can anyone give me any pointers on where to begin my research?

  • Seems like you're trying to write a middle man extenstion. – Taplar Sep 08 '20 at 22:38
  • You can use the standard DOM events in the content script to get the image file, and override `fetch` or `XMLHttpRequest` in [page context](/a/9517879) with your own code (see xhook.js) that will substitute the image. – wOxxOm Sep 09 '20 at 18:46

0 Answers0