0

In a site I don't have access to sources (developed in angularjs), I have a button to download a file, returning a blob of type application/pdf (with xmlhttprequest). Clicking the link, the browser (firefox) download it with a preset filename.

I would to intercept the returning call and get the file renamed before it's downloaded.

It's possible? Maybe I should add a onload listener to xmlhttprequest call, but I don't know where.

I looked for a solution in this post and in this one but I won't find a way.

Maybe I should add a response header ("content-disposition: attachment; filename=newname.pdf"), or I should get the blob data and provide my own download routine?

Is there a way with tampermonkey or a firefox extension?

I expect to get a file downloaded with a different name.

0 Answers0