Reputation: 147
I am developing an addon that shall intercept all file uploads and continue or abort them according to a user confirmation dialog.
Doing this with javascript DOM handling does not seem to fetch all possible ways of uploading files for arbitrary websites, since file uploads are no longer solely recognized by <input type="file">
and some sites are using flash elements for uploading.
Is there any way I can intercept either the file selection dialog or the file input stream to achieve this? Any other suggestions?
Upvotes: 1
Views: 528
Reputation: 4537
You could look into an http-on-modify-request observer (see https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers) as a way to catch any POST requests and see if they are uploading a file. Intercepting uploads via Flash will be much harder, however, since they may circumvent the Firefox stack completely and do their own communication with the website. In that case you would need to use some sort of OS-level hooks to intercept the upload.
Upvotes: 3