Added script that shows all tagesspiegel.de-comments.

This commit is contained in:
tastytea 2019-06-08 14:50:53 +02:00
parent 5fa7104be4
commit 504c9c8bf4
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,44 @@
// ==UserScript==
// @name Show tagesspiegel.de comments
// @description Show all comments on tagesspiegel.de
// @description:de Alle kommentare auf tagesspiegel.de anzeigen.
// @version 2019.06.08.1
// @author tastytea
// @copyright 2019, tastytea (https://tastytea.de/)
// @license GPL-3.0-only
// @namespace tastytea.de
// @homepageURL https://schlomp.space/tastytea/userscripts
// @supportURL https://schlomp.space/tastytea/userscripts/issues
// @downloadURL https://schlomp.space/tastytea/userscripts/raw/branch/main/comment-sections/tagesspiegel_show_comments.user.js
// @grant none
// @match https://*.tagesspiegel.de/*
// @run-at document-end
// @inject-into content
// ==/UserScript==
let interval;
let counter = 0;
function show_comments()
{
const showcomments = document.getElementsByClassName("ts-comments-toggle");
++counter;
if (counter >= 10) // Try 10 times.
{
clearInterval(interval);
}
if (showcomments.length === 0)
{
return;
}
clearInterval(interval);
if (showcomments.length > 0)
{
showcomments[0].click();
}
}
interval = setInterval(show_comments, 1000); // Wait until the button is loaded.