forked from tastytea/userscripts
ndr_download_button: Do not add button if there is one already.
This commit is contained in:
parent
a28fe215e3
commit
0c9abd4fb8
|
@ -2,7 +2,7 @@
|
||||||
// @name NDR download button
|
// @name NDR download button
|
||||||
// @description Adds a download-button for every video and audio on ndr.de.
|
// @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.
|
// @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
|
// @author tastytea
|
||||||
// @copyright 2019, tastytea (https://tastytea.de/)
|
// @copyright 2019, tastytea (https://tastytea.de/)
|
||||||
// @license GPL-3.0-only
|
// @license GPL-3.0-only
|
||||||
|
@ -39,6 +39,14 @@ function add_button(parent, url)
|
||||||
{
|
{
|
||||||
buttontext += " HD";
|
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");
|
const button = document.createElement("a");
|
||||||
button.setAttribute("class", "button download");
|
button.setAttribute("class", "button download");
|
||||||
|
|
Loading…
Reference in New Issue