FriendsInApp

adds a button "friends in the game"

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.

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

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