Remove restriction of steam workshop

Unlock adult content of steam for Chinese region users

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Remove restriction of steam workshop
// @name:zh-CN 移除steam创作工坊限制
// @description Unlock adult content of steam for Chinese region users
// @description:zh-CN 解除steam国区创作工坊内容限制
// @match       https://store.steampowered.com/account/preferences*
// @version     1.0.2
// @author      mokurin000
// @license MIT
// @namespace https://greasyfork.org/users/295326
// ==/UserScript==

window.addEventListener('load', () => {
  // Locate hidden div block of secret control
  const hidden_divs = document.querySelectorAll("div.account_setting_not_customer_facing");
  
  // Make them visible, optional
  for (let div of hidden_divs) {
    div.setAttribute("class", "preference_row");
  }
  
  // Actually enable settings
  for (let id of [4, 3]) {
    for (let suffix of ["store", "community"]) {
      const selector = `input#descriptor_${id}_${suffix}`;
      document.querySelector(selector).click();
    }
  }
}, false);