From 9bf6450d472e2eb0ec0f7d2df25a14095feb6f54 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 19 Feb 2022 04:32:17 +0100 Subject: [PATCH] Update for current Pleroma --- fediverse/pleroma_cw_toggle.user.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fediverse/pleroma_cw_toggle.user.js b/fediverse/pleroma_cw_toggle.user.js index e2c536b..fdf0c99 100644 --- a/fediverse/pleroma_cw_toggle.user.js +++ b/fediverse/pleroma_cw_toggle.user.js @@ -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);