Jinxin Util Button

界面按钮工具类

目前为 2024-02-10 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/460642/1325645/Jinxin%20Util%20Button.js

// ==UserScript==
// @name         Jinxin Util Button
// @namespace    https://gitee.com/jinxin11112/tampermonkey
// @version      0.1.0
// @description  界面按钮工具类
// @author       jinxin
// @icon         <$ICON$>
// @grant        GM_addStyle
// @resource     css https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css
// @license MIT
// ==/UserScript==

GM_addStyle(GM_getResourceText("css"));

function addDownloadButton(buttonFun) {

    let button = document.createElement('i');
    button.className = 'fa fa-download';
    button.innerHTML = '下载';
    // noinspection JSValidateTypes
    button.style = `
            position: fixed;
            bottom: 20px;
            left: 20px;
            display: flex;
            flex-direction: column;
            align-items: end;
            z-index: 999;
            cursor:pointer;
        `;
    button.addEventListener('click', buttonFun);
    (document.body || document.documentElement).appendChild(button);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址