I want Firefox to scan every page, and for every
<a href="URI">Text</a> element, I want
Text to be replaced with
Text [PDF] if
URI point to a PDF file (similar to Google Scholar results).
This is because I have Firefox configured to open PDFs externally, and I am annoyed by the extra blank tab from attempting to open them in a new tab, and the popup dialogs are an unwelcome surprise.
If possible, I would like it to automatically do this for every file that is configured to be opened with an external application under Options -> Applications.
I don't need any advanced logic - just a simple regex match for
\.(pdf|PDF)$ would suffice, but a smarter method would of course be even better. It would also be nice if it didn't append the
[PDF] when it's already appended, such as on the Google Scholar page, to avoid redundancy.
Ideally I'm looking for a Firefox extension.