-
Notifications
You must be signed in to change notification settings - Fork 10
/
subdh.user.js
34 lines (29 loc) · 869 Bytes
/
subdh.user.js
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
// ==UserScript==
// @name SubDH
// @version 2020.11.04
// @author ytzong
// @description
// @include http*://*subdh.*/*
// @copyright 2020+
// @run-at document-end
// @grant GM_addStyle
// ==/UserScript==
//
GM_addStyle('.btn-info{display:none} #magnets{position:fixed;right:0;bottom:0;width:300px;height:300px}')
$('body').append('<textarea id="magnets" />')
$('.mt-2 tr').click(function () {
$(this).addClass('bg-light')
let magnet = $(this).find('.btn-primary').attr('href')
console.log(magnet)
copyString(magnet)
let magnets = $('#magnets').val() + '\n' + magnet
magnets = magnets.trim()
$('#magnets').val(magnets)
})
function copyString(str) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val(str).select();
document.execCommand("copy");
$temp.remove();
}