复制Rongseven月份

复制rongseven@月份到剪切板

目前为 2025-02-01 提交的版本。查看 最新版本

// ==UserScript==
// @name        复制Rongseven月份
// @namespace   Violentmonkey Scripts
// @match        *://*/*
// @grant        GM_registerMenuCommand
// @grant        GM_setClipboard
// @grant        GM_notification
// @version     1.0
// @description  复制rongseven@月份到剪切板
// @author      -15d23
// @description 2025/2/1 12:18:49
// @license      GPL
// ==/UserScript==


(function() {
    'use strict';

    // 获取当前月份
    const currentMonth = new Date().getMonth() + 1; // getMonth()返回的月份是从0开始的,所以加1

    // 定义复制到剪贴板的操作
    function copyToClipboard() {
        const textToCopy = `rongseven@${currentMonth}`;
        GM_setClipboard(textToCopy); // 复制到剪贴板

        // 显示通知
        GM_notification({
            text: `已复制:${textToCopy}`,
            title: '复制成功',
            timeout: 2000,  // 显示2秒钟
        });
    }

    // 注册菜单项
    GM_registerMenuCommand(`复制 rongseven@${currentMonth}`, copyToClipboard);

})();