FriendsInApp

adds a button "friends in the game"

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         FriendsInApp
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  adds a button "friends in the game"
// @author       BAGOSI (vk.com/bagosi)
// @match        https://vk.com/*
// @grant        none
// ==/UserScript==

(function() {
    var observer = new MutationObserver(function (mutations) {
        mutations.forEach(function (mutation) {
            if (mutation.target.nodeType !== 1) return;
            if (cur.module=="app" && mutation.target.className!="fc_tab_title noselect" && !document.querySelector("#app_friends_info_btn")) addbtn();
        });
    });
    window.addEventListener("load", function () {
        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
    function addbtn() {
    var menu = document.getElementsByClassName("apps_options_bar_right apps_divided_links")[0];
    menu.innerHTML = '<a id="app_friends_info_btn" onclick="showBox(\'apps\', {act: \'show_app_friends_box\',aid: cur.aid})">Друзья в игре</a><span class="divider">|</span>'+menu.innerHTML;
    console.log("added");
    }
})();