Greasy Fork 支持简体中文。

POE自动续期cookie

自动续期cookie,使网页端,易刷,apt等工具保持登陆状态,by:放课后

目前為 2024-04-16 提交的版本,檢視 最新版本

// ==UserScript==
// @license MIT
// @name         POE自动续期cookie
// @namespace    http://tampermonkey.net/
// @version      2024-04-16
// @description  自动续期cookie,使网页端,易刷,apt等工具保持登陆状态,by:放课后
// @author       You
// @match        https://poe.game.qq.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=qq.com
// @grant        none

// ==/UserScript==

(function() {
    'use strict';
    const today = new Date();
    const nextYear = new Date();
    nextYear.setFullYear(nextYear.getFullYear() + 1);
    const expires = nextYear.toUTCString();
    const cookieValues = document.cookie.match(`(^|;)\\s*p_uin\\s*=\\s*([^;]+)`);
    const cookieValue = cookieValues ? cookieValues.pop() : '';
    if(cookieValue){
        document.cookie = `p_uin=${cookieValue}; expires=${expires}; path=/`;
    }
})();