Steam: Automatically check Subscriber Agreement checkboxes

Automatically checks Steam Subscriber Agreement checkboxes

2023-06-29 기준 버전입니다. 최신 버전을 확인하세요.

// ==UserScript==
// @name        Steam: Automatically check Subscriber Agreement checkboxes
// @namespace   zo8dd7kkrrnquyxs5yd2
// @match       https://store.steampowered.com/account/registerkey
// @match       https://store.steampowered.com/account/registerkey/
// @match       https://checkout.steampowered.com/checkout
// @match       https://checkout.steampowered.com/checkout/
// @match       https://steamcommunity.com/*
// @grant       none
// @version     1.5
// @description Automatically checks Steam Subscriber Agreement checkboxes
// @inject-into content
// @run-at      document-end
// @license     MIT
// ==/UserScript==

(function () {
	"use strict";

	const keepChecked = function (event) {
		if (!this.checked) {
			event.preventDefault();
		}
	};

	const chocolates = ["accept_ssa", "market_sell_dialog_accept_ssa", "market_buyorder_dialog_accept_ssa", "market_buynow_dialog_accept_ssa", "market_multi_accept_ssa"];

	for (let box of chocolates) {
		box = document.getElementById(box);

		if (box?.type === "checkbox") {
			box.checked = box.defaultChecked = true;
			box.tabIndex = -1;
			box.addEventListener("click", keepChecked);
		}
	}
})();