Greasy Fork

Greasy Fork is available in English.

天锐绿盾魔法

天锐绿盾本地解密!

当前为 2024-07-02 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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);
    });
})();