Chrome 开发者工具修改全局时钟时间
Chrome About 479 wordsConsole
在Console中执行。以下代码模拟时钟快5分钟。
(() => {
const OFFSET = 5 * 60 * 1000; // 快 5 分钟
const _Date = Date;
function MockDate(...args) {
if (args.length === 0) {
return new _Date(_Date.now() + OFFSET);
}
return new _Date(...args);
}
MockDate.now = () => _Date.now() + OFFSET;
MockDate.UTC = _Date.UTC;
MockDate.parse = _Date.parse;
MockDate.prototype = _Date.prototype;
window.Date = MockDate;
console.log("✅ Date mocked: +5 minutes");
})();
Views: 15 · Posted: 2026-04-10
———         Thanks for Reading         ———
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...