您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Suppresses age confirmations on Steam store pages and community hubs
当前为
// ==UserScript== // @name Steam: Bypass age confirmation prompts // @namespace steam // @version 1.7 // @description Suppresses age confirmations on Steam store pages and community hubs // @license MIT // @match https://steamcommunity.com/* // @match https://store.steampowered.com/agecheck/app/* // @match https://store.steampowered.com/app/*/agecheck* // @grant none // @run-at document-start // @inject-into content // ==/UserScript== (function () { "use strict"; if (location.hostname === "store.steampowered.com") { // Set up long-lived cookies (10 years) to bypass age verification const cookieOptions = "; Secure; Path=/; Max-Age=315360000; SameSite=None"; // This bypasses the "mature content - view page/cancel" screen. // Overrides the settings you set here: https://store.steampowered.com/account/preferences/ document.cookie = "wants_mature_content=1" + cookieOptions; // This bypasses the "enter your date of birth" screen. const fiftyYearsAgo = ((Date.now() - 1576800000000) / 1000).toFixed(); document.cookie = "birthtime=" + fiftyYearsAgo + cookieOptions; // Reload after making sure we're actually on a page with an age gate window.addEventListener("DOMContentLoaded", function () { if (document.getElementById("app_agegate")) { location.reload(); } }); } else if (location.hostname === "steamcommunity.com") { // Patch Storage.getItem to return a fake value for all keys that look like age_gate_123. // This bypasses the mature content overlay on community hubs. const patchSessionStorage = function () { const overrideRegex = /^age_gate_\d+$/; Storage.prototype.getItem = new Proxy(Storage.prototype.getItem, { apply(getItem, that, args) { if (args.length && that === window.sessionStorage && overrideRegex.test(String(args[0]))) { return "1"; } return getItem.apply(that, args); } }); }; const inject = `"use strict";(${patchSessionStorage})();`; if ("wrappedJSObject" in window) { // Firefox sandbox, execute it directly window.eval(inject); } else { // Chrome sandbox or no sandbox, inject script tag const script = document.createElement("script"); script.text = inject; (document.head ?? document.documentElement).prepend(script); script.remove(); } } })();