views:

44

answers:

2

Is there any way to detect whether a download has completed or is how much it has downloaded , in the context of a greasemonkey script Or and extension .(i.e) how to detect if firefox is still downloading a file or not, in a greasemonkey script or an extension ?

Also please give a Reliable way for using jQuery in greasemonkey.

+1  A: 

Allowing Javascript to have access to native functionality of your browser (such as downloading) would be a security hole, and is therefore not possible.

Jamie Wong
+2  A: 

As Jamie Wong said, neither a Greasemonkey script (nor JavaScript) can tell the status of a file-download, client-side.

However, if your JavaScript is loading from a server you control, you can set up a system to poll the server about download status.

But, yes, you could write a Firefox extension that can see file download status.
......

As for using jQuery in GM, you can see a simple Greasemonkey script, that uses jQuery, in this stackoverflow answer.

Brock Adams