Update for current Pleroma

This commit is contained in:
tastytea 2022-02-19 04:32:17 +01:00
parent 706a49885f
commit 9bf6450d47
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 9 additions and 4 deletions

View File

@ -1,9 +1,9 @@
// ==UserScript==
// @name Pleroma CW toggle
// @description Adds a button to toggle the visibility of all statuses with content warnings on status-pages, profile-pages and timelines.
// @version 2019.06.25.2
// @version 2022.02.19.2
// @author tastytea
// @copyright 2019, tastytea (https://tastytea.de/)
// @copyright 2019, 2022, tastytea (https://tastytea.de/)
// @license GPL-3.0-only
// @namespace tastytea.de
// @homepageURL https://schlomp.space/tastytea/userscripts
@ -106,9 +106,14 @@ function check()
parent = root[0].parentElement;
}
// if root element and a status was found, disable interval and add button.
if (root.length !== 0
&& parent.getElementsByClassName("status-content").length > 0)
if (root.length !== 0)
{
if (!parent.getElementsByClassName("StatusContent").length > 0
&& !parent.getElementsByClassName("status-content").length > 0)
{
return;
}
if (is_static)
{
clearInterval(interval);