forked from tastytea/userscripts
more Misskey 13 fixes for Misskey CW toggle
it actually toggles now! 🎉
This commit is contained in:
parent
4dfe33bd4c
commit
886a214924
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name Misskey CW toggle
|
||||
// @description Adds a button to toggle the visibility of all notes with content warnings on note-pages.
|
||||
// @version 2023.1.26.1
|
||||
// @version 2023.1.26.2
|
||||
// @author tastytea
|
||||
// @copyright 2022-2023, tastytea (https://tastytea.de/)
|
||||
// @license GPL-3.0-only
|
||||
|
@ -32,13 +32,16 @@ function toggle() {
|
|||
if (root === undefined) {
|
||||
return;
|
||||
}
|
||||
for (let status of root.getElementsByClassName("cw")) {
|
||||
const cw_classes = ["cw", "xpfPt"];
|
||||
for (let classname of cw_classes) {
|
||||
for (let status of root.getElementsByClassName(classname)) {
|
||||
let button = status.getElementsByTagName("button")[0];
|
||||
if (button === undefined) {
|
||||
continue;
|
||||
}
|
||||
button.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add a “Toggle all CWs”-button.
|
||||
|
|
Loading…
Reference in New Issue
Block a user