Greasy Fork is available in English.
天锐绿盾本地解密!
当前为
// ==UserScript==
// @name 天锐绿盾魔法
// @namespace http://tampermonkey.net/
// @version 0.3.2
// @description 天锐绿盾本地解密!
// @author xiuyuan
// @match *://*/*
// @grant none
// @noframes
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Create a new input element
const input1 = document.createElement('input');
input1.type='file';
input1.style.display='none';
const input2 = document.createElement('input');
input2.type='file';
input2.style.display='none';
input2.multiple=true;//'directory webkitdirectory';
input2.directory=true;
input2.webkitdirectory=true;
// Create a new button element
const button = document.createElement('button');
button.innerText = '魔法';
const button2 = document.createElement('button');
button2.innerText = '超级\n魔法';
// Change the button style
button.style.backgroundColor = 'black';
button.style.color = 'white';
button.style.position = 'fixed';
button.style.bottom = '150px';
button.style.right = '5px';
button.style.zIndex = '9999';
button.style.width ='60px';
button.style.height = '30px';
// Change the button2 style
button2.style.backgroundColor = 'black';
button2.style.color = 'white';
button2.style.position = 'fixed';
button2.style.bottom = '180px';
button2.style.right = '5px';
button2.style.zIndex = '9999';
button2.style.width ='60px';
button2.style.height = '50px';
// Add the button to the page
document.body.appendChild(input1);
document.body.appendChild(button);
document.body.appendChild(input2);
//document.body.appendChild(button2);
button.addEventListener('click', () => {input1.click();});
button2.addEventListener('click', () => {input2.click();});
input1.addEventListener('change', () => {
var file = input1.files[0];
var reader = new FileReader();
reader.onload = function(e) {
var renamedContent = file.name;
console.log(renamedContent);
var blob = new Blob([e.target.result], { type: file.type });
var url = URL.createObjectURL(blob);
var downloadLink = document.createElement("a");
downloadLink.href = url;
//downloadLink.setAttribute('download', renamedContent);
//downloadLink.style.display = 'block';
downloadLink.download =renamedContent;
downloadLink.click();
}
reader.readAsArrayBuffer(file);
});
})();