-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiple-Files Downloader.user.js
More file actions
69 lines (63 loc) · 2.51 KB
/
Copy pathMultiple-Files Downloader.user.js
File metadata and controls
69 lines (63 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// ==UserScript==
// @name Multiple-Files Downloader
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Fix multiple downloads
// @author R1
// @match https://alldebrid.*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=alldebrid.fr
// @grant none
// ==/UserScript==
(function () {
'use strict';
var parentDiv = document.querySelector('.serviceResults.boxYellow');
var greenDiv = document.getElementById('dlThemAll');
if (greenDiv !== null) {
var newDiv = document.createElement('div');
newDiv.classList.add('redBtn');
newDiv.removeAttribute("id");
newDiv.textContent = 'Un problème de téléchargement ?';
newDiv.addEventListener('click', function () {
const pTags = document.querySelectorAll('.link-center');
for (let i = 0; i < pTags.length; i++) {
console.log(pTags[i])
//pTags[i].querySelector('a').setAttribute('download', '');
pTags[i].querySelector('a').classList.add('dlLink');
}
});
greenDiv.insertAdjacentElement('afterend', newDiv);
} else {
console.log("La div avec l'id 'dlThemAll' n'a pas été trouvée.");
}
// Créer une nouvelle balise <style> et y ajouter du CSS
var style = document.createElement("style");
style.innerHTML = `
.redBtn {
-moz-box-shadow: inset 0 1px 0 0 #a4e271;
-webkit-box-shadow: inset 0 1px 0 0 #d8687a;
box-shadow: inset 0 1px 0 0 #d8687a;
background: -webkit-gradient(linear,left top,left bottom,color-stop(0.05,#ad253b),color-stop(1,#7e1122));
background: -moz-linear-gradient(top,#70b126 5%,#508813 100%);
background: -webkit-linear-gradient(top,#ad253b 5%,#7e1122 100%);
background: -o-linear-gradient(top,#70b126 5%,#508813 100%);
background: -ms-linear-gradient(top,#70b126 5%,#508813 100%);
background: linear-gradient(to bottom,#ad253b 5%,#7e1122 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#70b126',endColorstr='#508813',GradientType=0);
background-color: #ad253b;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #601a25;
display: inline-block;
cursor: pointer;
color: #fff!important;
font-size: 13px;
padding: 6px 24px;
text-decoration: none;
font-weight: 700;
text-shadow: 0 1px 0 #690f1e;
}
`;
// Ajouter la balise <style> au <head> de la page
document.head.appendChild(style);
})();