免VPN遊玩DMM網頁遊戲

修改DMM網頁的cookie值

当前为 2025-07-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         免VPN遊玩DMM網頁遊戲
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  修改DMM網頁的cookie值
// @include      *://*.dmm.*/*
// @run-at       document-start
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const targetDomains = ['dmm.co.jp', 'dmm.com'];
    if (!targetDomains.some(domain => location.hostname.includes(domain))) return;

    const domains = ['.dmm.co.jp', '.dmm.com'];
    const oldValue = 'ckcy_remedied_check=ktkrt_argt';
    const newValue = 'ec_mrnhbtk';

    let maxAttempts = 10;
    let delay = 300;

    const tryReplaceCookie = () => {
        if (document.cookie.includes(oldValue)) {
            domains.forEach(domain => {
                document.cookie = `ckcy_remedied_check=${newValue}; path=/; domain=${domain}`;
            });
            console.log('✅ Cookie 修改成功:ckcy_remedied_check=ec_mrnhbtk');
        } else if (maxAttempts-- > 0) {
            setTimeout(tryReplaceCookie, delay);
        } else {
            console.warn('⚠️ 無法找到目標 Cookie,結束重試');
        }
    };

    setTimeout(tryReplaceCookie, delay);
})();

QingJ © 2025

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