Hyper FaceIt

try to take over the world!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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.

(I already have a user style manager, let me install it!)

// ==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();
        });
    });
})();