forked from tastytea/userscripts
Log error if no parent-element is found.
This commit is contained in:
parent
73c38258f1
commit
b36a037016
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Mastodon CW toggle
|
// @name Mastodon CW toggle
|
||||||
// @description Toggles the visibility of all statuses with content warnings on status-pages.
|
// @description Toggles the visibility of all statuses with content warnings on status-pages.
|
||||||
// @version 2019.05.29.2
|
// @version 2019.05.29.3
|
||||||
// @author tastytea
|
// @author tastytea
|
||||||
// @copyright 2019, tastytea (https://tastytea.de/)
|
// @copyright 2019, tastytea (https://tastytea.de/)
|
||||||
// @license GPL-3.0-only
|
// @license GPL-3.0-only
|
||||||
|
@ -49,6 +49,7 @@ function add_button()
|
||||||
root = document.getElementsByClassName("footer")[0];
|
root = document.getElementsByClassName("footer")[0];
|
||||||
if (root === undefined)
|
if (root === undefined)
|
||||||
{
|
{
|
||||||
|
console.log(`Error: no suitable parent-element found.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue