您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevents cookies from being set from NYTimes
// ==UserScript== // @name NYTimes - Prevent cookies // @namespace http://tampermonkey.net/ // @version 0.2 // @description Prevents cookies from being set from NYTimes // @author You // @match https://*.nytimes.com/* // @grant none // ==/UserScript== (function() { 'use strict'; const getCummulative = (str, delim, reverse = false) => { const parts = str.split(delim); return parts .map((_, i) => parts.slice(reverse ? 0 : i, reverse ? parts.length - i : parts.length).join(delim) || delim); } const clearCookies = () => { const cookies = document.cookie.split('; ') .map(cookie => cookie.match(/([^=;]+)/)) .filter(cookie => cookie) .map(([_, cookie]) => encodeURIComponent(cookie)); const subdomains = getCummulative(location.hostname, '.'); const paths = getCummulative(location.pathname, '/', true) const nextCookies = cookies .map(cookie => subdomains .map(domain => paths .map(path => cookie +'=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + domain + ' ;path=' + path ))) .flat(3); nextCookies.forEach(cookie => document.cookie = cookie); } clearCookies(); setInterval(() => { clearCookies(); }, 5000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址