// ==UserScript== // @name La Stampa TopNews Full Text Articles // @namespace https://andrealazzarotto.com // @version 1.3.1 // @description Uncovers the "paywalled" articles on La Stampa TopNews // @author Andrea Lazzarotto // @match http://www.lastampa.it/topnews/* // @match https://www.lastampa.it/topnews/* // @match http://www.lastampa.it/tuttosoldi/* // @match https://www.lastampa.it/tuttosoldi/* // @require https://code.jquery.com/jquery-latest.min.js // @grant GM_xmlhttpRequest // @grant GM.xmlHttpRequest // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html // @downloadURL none // ==/UserScript== /* Greasemonkey 4 wrapper */ if (typeof GM !== "undefined" && !!GM.xmlHttpRequest) { GM_xmlhttpRequest = GM.xmlHttpRequest; } function fetch(params) { return new Promise(function(resolve, reject) { params.onload = resolve; params.onerror = reject; GM_xmlhttpRequest(params); }); } (function() { 'use strict'; if (location.href.endsWith('amp/')) { location.href = location.href.slice(0, -4); } fetch({ method: 'GET', url: location.pathname + '/amp', }).then(function(responseDetails) { var r = responseDetails.responseText; r = r.replace(/