自用工具库

自用

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.sleazyfork.org/scripts/393263/755027/%E8%87%AA%E7%94%A8%E5%B7%A5%E5%85%B7%E5%BA%93.js

// ==UserScript==
// @author 殁漂遥
// @namespace http://tampermonkey.net/
// @name 自用工具库
// @version 1.00
// @grant none
// ==/UserScript==

// 设置 Cookie 默认时间 一年
function setCookie(name, value) {
    let exp = new Date();
    exp.setTime(exp.getTime() + 365 * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}