Greasy Fork

KN Paywall Killer

A script that removes paywall from Kieler Nachrichten articles (KN+) by copying the article text from an script element in the source code into the body.

目前为 2022-08-11 提交的版本。查看 最新版本

// ==UserScript==
// @name KN Paywall Killer
// @description A script that removes paywall from Kieler Nachrichten articles (KN+) by copying the article text from an script element in the source code into the body.
// @description:de Ein Skript, dass die Paywall in Artikeln der Kieler Nachrichten (KN+) entfernt, indem es den Artikeltext aus einem Skript im Quelltext in den Body kopiert
// @include https://www.kn-online.de/*
// @namespace Discostu36/KN-Paywall-Killer
// @run-at document-idle
// @version 1.0
// @license MIT
// ==/UserScript==


var paywall = document.querySelector(".paywall");
var contentScript = document.querySelectorAll("script[type='application/ld+json']")[2]; 
var contentObject = JSON.parse(contentScript.text);
var articleBody = contentObject.articleBody; 
var descriptionP = document.querySelector(".ArticleHeadstyled__ArticleTeaserContainer-sc-1xd2qac-1");
var bodySpan = document.querySelector(".Textstyled__InlineText-sc-14jlruk-1"); 
var contentLoader = document.querySelector("#article > svg")
var contentLoaderGradient = document.querySelector(".ArticleContentLoaderstyled__Gradient-sc-1npmba7-0") 
if (paywall!=null) {
paywall.remove();
contentLoader.remove()
contentLoaderGradient.remove() 
descriptionP.classList.remove("jgJYOM");
bodySpan.innerHTML = articleBody; 
bodySpan.parentElement.nextSibling.remove();
}