Is there any reliable way to capture a file upload event in a chrome extension?

In my script content, I want to keep track of which file a is being uploaded to a web application.

I am tracking the change event for any input: file element. It works on any site (for example, Gmail) that uses "input: file".

However, sites like imgur use the SWFUpload mechanism. I tried to capture the "fileQueued" event on an element that I suspected was swfupload. But that did not work.

  • How can I capture a file upload event for sites using swfupload?
  • Are there other plugins that control the upload of files that I will need to take care of in my content script?
  • Is there any general mechanism to solve this problem?

(I know the drag-n-drop mechanism, but so far I have not handled this case. I also read the corresponding question about SO:

Grab the chrome file before uploading )

+4
source share
1 answer

You should probably experiment with the chrome.webRequest API; it looks like the onBeforeRequest event contains file loading information. This is a complex API with additional parameters for addListener; read the documents carefully.

0
source

All Articles