views:

30

answers:

1

Hi, I get a idea writing a greasemonkey user javascript that can detect which is the exactly real download link rather than an advertisement link or something else .

Actually, I find that some real download link is linked to .php . It's tough to detect it I think.

how could I do that, any ideas?

+2  A: 

The only reliable way to do it is to follow the link and check what Content-type you will find in the header of the response. If you can, try to send a HEAD request instead of a GET. That will give you the information you need without actually starting the download.

Aaron Digulla