ccc_media_player_down: Move above the share-widget.

because “Related” is not always there.
This commit is contained in:
tastytea 2019-08-10 17:33:08 +02:00
parent 480bf91811
commit a1104d5fdc
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
// @name CCC-media video-player down-mover
// @description Moves video-players on media.ccc.de below the download-hyperlinks.
// @description:de Verschiebt video-player auf media.ccc.de unter die download-hyperlinks.
// @version 2019.06.18.1
// @version 2019.08.10.1
// @author tastytea
// @copyright 2019, tastytea (https://tastytea.de/)
// @license GPL-3.0-only
@ -25,15 +25,15 @@ function main()
return;
}
// Move player between “Download” and “Related”.
for (let heading of document.getElementsByTagName("h3"))
const share = document.getElementsByClassName("share")[0];
if (player === undefined)
{
if (heading.textContent === "Related")
{
heading.parentElement.insertBefore(player, heading);
break;
}
console.error("Share-widget not found.");
return;
}
// Move player just above the share-widget.
share.parentElement.insertBefore(player, share);
}
main();