The site has a <a/>
link with the href
attribute.
If you click on it, the file specified in the href
will open in a new tab.
I need javascript or jQuery that will modify the file before it opens and then open it in a new tab.
Ok. more info. Sorry for my bad English.
There is an element on the page:
<a href="https://example.com/something.user.css" target="_blank">Install usercss</a>
If you click on it the browser will open a new tab with this file and the Stylus extension offer to install this style. But this style is broken.
I want to write userscript that will download this file, delete broken part in it and open it in the new tab so that the Stylus pick it up and offer to install the fixed style.