您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Suppresses age confirmations on Steam store pages and community hubs
当前为
- // ==UserScript==
- // @name Steam: Bypass age confirmation prompts
- // @namespace steam
- // @version 2.0
- // @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";
- // Set up 1 month cookies to bypass age verification
- const cookieOptions = "; Secure; Path=/; Max-Age=2592000; SameSite=None";
- // This cookie bypasses the "mature content - view page/cancel" screen.
- // It works on both community and the store.
- document.cookie = "wants_mature_content=1" + cookieOptions;
- if (location.hostname === "store.steampowered.com") {
- // This cookie bypasses the "enter your date of birth" screen.
- const twentyFiveYearsAgo = ((Date.now() - 788_400_000_000) / 1000).toFixed();
- document.cookie = "birthtime=" + twentyFiveYearsAgo + cookieOptions;
- // Reload after making sure we're actually on a page with an age gate
- window.addEventListener("DOMContentLoaded", () => {
- if (document.getElementById("app_agegate")) {
- location.reload();
- }
- });
- } else if (location.hostname === "steamcommunity.com") {
- // Auto reload if we managed to land on an age gate on our very
- // first load. The wants_mature_content cookie should prevent this.
- window.addEventListener("DOMContentLoaded", () => {
- const proceed = function (context = window) {
- if ("AcceptAppHub" in context) {
- context.Proceed?.();
- }
- };
- if ("wrappedJSObject" in window) {
- // Firefox sandbox, bypass and execute directly
- proceed(window.wrappedJSObject);
- } else {
- // Inject as script tag otherwise
- const script = document.createElement("script");
- script.text = `"use strict";(${proceed})();`;
- (document.head ?? document.documentElement).prepend(script);
- script.remove();
- }
- });
- }
- })();