Greasy Fork is available in English.
修改DMM網頁的cookie值
当前为
// ==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);
})();