Hyper FaceIt

try to take over the world!

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Hyper FaceIt
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  try to take over the world!
// @author       You
// @match        https://*.faceit.com/*
// @grant        none
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @require      https://cdn.jsdelivr.net/gh/khaimovmr/[email protected]/wsHook.js
// ==/UserScript==

(function() {
    'use strict';

    window.wsHook.after = function(messageEvent, url, wsObject) {
        if (typeof(messageEvent.data) != 'string') {
            return messageEvent;
        }

        var bodyStart = messageEvent.data.search('<body>');
        var bodyEnd = messageEvent.data.search('</body>');

        if (bodyStart > -1 && bodyEnd > -1) {
            let message = messageEvent.data.slice(bodyStart + 6, bodyEnd);
            console.log(message);
        }

        return messageEvent;
    }

    $(document).ready(function() {
        let styleElement = document.createElement('style');
        styleElement.innerHTML = '.sc-jjOAeO.hbbTPq:hover {cursor: pointer;}';
        styleElement.type = 'text/css';
        document.head.insertBefore(styleElement, document.head.firstChild);
        //$('head').append('<style>.sc-jjOAeO.hbbTPq:hover {cursor: pointer;}</style>');
        $(document).on('click', '.sc-jjOAeO.hbbTPq', function(){
            var parent = $(this).parent();
            parent.parent().find('input[type=radio]').prop('checked', false);
            parent.find('input[type=radio]').parent().click();
        });
    });
})();