Greasy Fork

Lemonde.fr noscript URLs

Permet d'utiliser le site lemonde.fr sans javascript (noscript), avec des hyperliens fonctionnels. Necessite un navigateur récent.

目前为 2018-08-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         Lemonde.fr noscript URLs
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Permet d'utiliser le site lemonde.fr sans javascript (noscript), avec des hyperliens fonctionnels. Necessite un navigateur récent.
// @author       Jules Samuel Randolph
// @match        https://www.lemonde.fr/
// @grant        none
// ==/UserScript==

(function() {
    document.querySelectorAll('span[data-href]').forEach(function (n) {
        const href = atob(n.getAttribute('data-href'))
        const anchor = document.createElement("a")
        anchor.setAttribute("href", href)
        anchor.textContent = n.textContent
        anchor.className = n.className
        n.replaceWith(anchor)
    })
})();