// ==UserScript== // @name The Wall Street Journal Full Text Articles // @name:it The Wall Street Journal - Articoli con testo completo // @namespace iamfredchu // @version 0.0.1 // @description Fetch the full text of The Wall Street Journal articles from the AMP version // @description:it Mostra il testo completo degli articoli su The Wall Street Journal // @author Fred Chu // @match https://www.wsj.com/articles/* // @match https://cn.wsj.com/articles/* // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.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'; var paywalled = $("#cx-snippet-promotion"); if (!!paywalled) { fetch({ method: 'GET', url: '/amp' + location.pathname, }).then(function(responseDetails) { var r = responseDetails.responseText; r = r.replace(/