Home:ALL Converter>Modify the file before it opens and then open it in a new tab

Modify the file before it opens and then open it in a new tab

Ask Time:2020-05-22T06:38:12         Author:almaceleste

Json Formatter

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.

Author:almaceleste,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/61944940/modify-the-file-before-it-opens-and-then-open-it-in-a-new-tab
yy