Last active
June 30, 2020 00:34
-
-
Save ndefrancesco/f45a6d6e858802c6edad2603bbc7f15f to your computer and use it in GitHub Desktop.
Clean Pubmed Search Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Clean Pubmed Search Links | |
// @namespace https://github.com/ndefrancesco | |
// @version 1.0 | |
// @author Nicolás De Francesco | |
// @include https://pubmed.ncbi.nlm.nih.gov/* | |
// @include http://pubmed.ncbi.nlm.nih.gov/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
// ==/UserScript== | |
/* | |
This Greasemonkey script strips the query string from the new PubMed search result links. | |
As a result, the browser will still recognize the link as visited, regardless of the search query it comes from. | |
The substitution will result in clearing the search query in the linked page (i.e.: it's not replicated in the search bar). | |
*/ | |
var PubMedDocumentLinks = $("div.docsum-content a.labs-docsum-title"); | |
PubMedDocumentLinks.each ( function () { | |
var jThis = $(this); | |
var href = jThis.attr("href").replace(/\?.*$/,""); | |
jThis.attr("href", href); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment