From 0c9abd4fb8333b50136eca6e5a5a1652b8668330 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 17 Jun 2019 13:47:21 +0200 Subject: [PATCH] ndr_download_button: Do not add button if there is one already. --- video/ndr_download_button.user.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/video/ndr_download_button.user.js b/video/ndr_download_button.user.js index 4f8ba41..d49a124 100644 --- a/video/ndr_download_button.user.js +++ b/video/ndr_download_button.user.js @@ -2,7 +2,7 @@ // @name NDR download button // @description Adds a download-button for every video and audio on ndr.de. // @description:de Fügt einen download-button für jedes videos und audio auf ndr.de hinzu. -// @version 2019.06.17.2 +// @version 2019.06.17.3 // @author tastytea // @copyright 2019, tastytea (https://tastytea.de/) // @license GPL-3.0-only @@ -39,6 +39,14 @@ function add_button(parent, url) { buttontext += " HD"; } + else + { + // If there is already an equivalent download-button, do nothing. + if (document.getElementsByClassName("button download").length > 0) + { + return; + } + } const button = document.createElement("a"); button.setAttribute("class", "button download");