CB ModUI Tweaks

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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();