CB ModUI Tweaks

Try to take over the world (w/o Pinky)!

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

Advertisement:

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

Advertisement:

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         CB ModUI Tweaks
// @namespace    http://tampermonkey.net/
// @version      2026-07-07
// @description  Try to take over the world (w/o Pinky)!
// @author       [email protected] (Joe Johnson)
// @match        *://*.chaturbate.com/*
// @match        *://chaturbate.com/*
// @icon         http://chaturbate.com/favicon.ico
// @grant        none
// ==/UserScript==

/* Instruction:
* You should only need to edit cb.env or cb.selectors (when the HTML changes).
* This script removes nav genders other than that specified in cb.env.GENDERS.
* Pressing the middle mouse button takes you to the top of the page.
* A button is added after 'filters' to select a random room.
*/

window.CB = (function(win, undefined) {
  'use strict';

  const cb = window.CB ?? {};

  cb.env = {
    ROOM_BORDER_STYLE: '1px dashed orange',
    RANDOM_BUTTON: 'Random Room!',
    GENDERS: ['Women']
  };

  cb.selectors = {
    base: {
      HeaderNav: 'nav.HeaderNavBar[aria-hidden="false"]',
      UserMenu: '.HeaderUserMenu'
    },
    main: {
      Filter: '.advanced-search-button-container',
      GenderNav: '.GenderNav > div',
      RoomList: '#roomlist_root ul',
    }
  };

  cb.removeGenders = (visibleGenders) => {
    let tabcount = 0;
    cb.genders.querySelectorAll('button').forEach(el => {
      const visible = cb.env.GENDERS.includes(el.innerText);
      el.style.display = visible ? 'inline-block' : 'none';
      if (visible) tabcount++;
    });
    if (tabcount < 2) {
      cb.filter.style.top = '-42px';
      cb.genders.style.display = 'none';
      cb.filter.parentNode.style.height = 0;
      cb.filter.parentNode.style.minHeight = 0;
    }
  };

  cb.selectRandomRoom = () => {
    const rooms = cb.roomlist.childNodes;
    const rn = Math.floor(Math.random() * rooms.length);
    rooms[rn].scrollIntoView();
    rooms.forEach((room, i) => {
      room.style.border = (rn === i) ? cb.env.ROOM_BORDER_STYLE : 'none';
    });
  };

  cb.setupRandomRoomUI = () => {
    const button = document.createElement('button');
    const li = document.createElement('li');
    button.innerText = cb.env.RANDOM_BUTTON;
    button.onclick = cb.selectRandomRoom;
    cb.filter.append(li.appendChild(button));
  };

  cb.setupGoToTop = () => {
    document.addEventListener('mouseup', (event) => {
      if (event.button === 1) {
        window.scrollTo(0,0);
      }
    });
  };

  cb.setup = () => {
    cb.nav = document.querySelector(cb.selectors.base.HeaderNav);
    cb.usermenu = document.querySelector(cb.selectors.base.UserMenu);
    cb.genders = document.querySelector(cb.selectors.main.GenderNav);
    cb.roomlist = document.querySelector(cb.selectors.main.RoomList);
    cb.filter = document.querySelector(cb.selectors.main.Filter);
    cb.setupRandomRoomUI();
    cb.removeGenders();
    cb.setupGoToTop();
  };

  return cb;

})(window);

window.CB.setup();