TwitchWithoutCasino

An extension that removes all casino broadcasts from the page https://www.twitch.tv/directory/all

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

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

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

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

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

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

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

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

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

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

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

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

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

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

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         TwitchWithoutCasino
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  An extension that removes all casino broadcasts from the page https://www.twitch.tv/directory/all
// @author       You
// @match        https://www.twitch.tv/directory/all/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitch.tv
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function test(){
        if (window.location.href.indexOf('category') != -1) {
            return
        }
        let categoryNames = ['Casino Slot Machine', 'Virtual Casino', 'The Casino: Roulette, Video Poker, Slot Machines, Craps, Baccarat', 'Casino Jackpot']
        let slot_card = document.querySelectorAll('div[style*="order"]')
        for( let i = 1; i < slot_card.length; i++){
            let category = slot_card[i].querySelector('a[data-a-target="preview-card-game-link"]')
            if (category){
                category = category.innerHTML
                if (categoryNames.includes(category)){
                    let parent = slot_card[i].parentNode
                    parent.removeChild(slot_card[i])
                    console.log('Casino Removed!')
                }
            }
            else {
                let parent = slot_card[i].parentNode
                parent.removeChild(slot_card[i])
                console.log('Casino Removed!')
            }
        }
    }
    setInterval(test, 5000)
})();