mcawesomept / Remove Links

// ==UserScript==
// @name         Remove Links
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Transforms the page's anchor links into spans with the anchor's text.
// @author       mcawesomept
// @match        https://domus.ipp.pt/*
// @grant        none
// @license      MIT
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    console.log("USER SCRIPT: replacing links as text...");
    var clearAnchorBtn = "<input id='clearAnchorBtn' type='button' value='clear anchors' />";
    $("body").append(clearAnchorBtn);

    $("#clearAnchorBtn").click(function(){
        $("a").each(function(){
            var linkText = $(this).text().trim(" ");
            //console.log(linkText);
            $(this).replaceWith(function(){
                return $("<span>" + linkText + "</span>");
            });
        });
        $("#clearAnchorBtn").remove();
    });

})();