HTML5 for arXiv

An extension that makes html5 source available in arxiv.org based on the amazing ar5iv project.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         HTML5 for arXiv
// @namespace    http://tampermonkey.net/
// @version      0.2
// @name:zh-CN   HTML5 for arXiv
// @description  An extension that makes html5 source available in arxiv.org based on the amazing ar5iv project.
// @description:zh-cn 更便捷的访问HTML5论文!
// @author       AnCoSONG
// @license      MIT
// @match        https://arxiv.org/abs/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=arxiv.org
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function setup() {
        try {
            var prefix = location.pathname
            var ul = document.querySelector('.full-text ul')
            var li = document.createElement('li')
            var a = document.createElement('a')
            a.href = 'https://ar5iv.org' + prefix
            a.innerText = 'Ar5iv'
            a.className = 'abs-button'
            a.target = '_blank'
            li.appendChild(a)
            ul.insertBefore(li,ul.children[0])
        }catch(e) {
            console.log('error happened, skip.\n', e)
        }
    }
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', setup)
    } else {
        setup()
    }
})();