Created
July 20, 2024 10:21
-
-
Save lincerely/a91fa88b19698e546303a15a43957689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 arxiv: add link to ar5iv and academ.us | |
// @version 1 | |
// @grant none | |
// @include https://arxiv.org/abs/* | |
// ==/UserScript== | |
function add_link() { | |
let url_ar5iv = document.URL.replace("arxiv","ar5iv"); | |
let li_ar5iv = document.createElement('li'); | |
li_ar5iv.innerHTML = '<a href="' + url_ar5iv + '">HTML (ar5iv)</a>'; | |
document.querySelector("#abs-outer .extra-services .full-text ul :nth-child(2)").after(li_ar5iv); | |
let url_academus = "https://academ.us/search_result/?query=" + encodeURI(document.URL); | |
let li_academus = document.createElement('li'); | |
li_academus.innerHTML = '<a href="' + url_academus + '">HTML (academ.us)</a>'; | |
li_ar5iv.after(li_academus); | |
}; | |
window.addEventListener("load", add_link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment