From a1104d5fdcd3c99f738d9dac69cb82466ab5bf1b Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 10 Aug 2019 17:33:08 +0200 Subject: [PATCH] ccc_media_player_down: Move above the share-widget. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit because “Related” is not always there. --- video/ccc_media_player_down.user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/video/ccc_media_player_down.user.js b/video/ccc_media_player_down.user.js index 5e2addf..2aa340d 100644 --- a/video/ccc_media_player_down.user.js +++ b/video/ccc_media_player_down.user.js @@ -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();