VKgrupNum

Показывает нумерацию в поиске групп vk.com

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name VKgrupNum
// @namespace Sanek508 
// @description Показывает нумерацию в поиске групп vk.com
// @match       https://vk.com/groups?act=catalog*
// @include 	https://vk.com*
// @author Sanek508
// @version 0.1
// @grant       none
// ==/UserScript==


   // можете добавить сюда свои сайты для подсветки
   url = ['/alpha-t','/alpha_t','/alphat','/alpha','/remontika38']; /* подсвечиваемый домен */
   var start = 0;
  
    [].forEach.call(document.getElementsByClassName("search_results"), function (e) {
     /* Перебор результатов в блоке выдачи */
     [].forEach.call(e.querySelectorAll(".groups_row"), function (d) {
       start++;
       /* Создание элемента нумерации */
       var t = document.createElement("span");
       t.setAttribute("style", "float:left;margin-left:5px;padding-top:0px;");
       t.innerHTML = start + "";
       d.insertBefore(t, d.firstChild);
       /* Перебор ссылок результата и подсветка url */
		 
       [].forEach.call(d.getElementsByClassName("labeled title"), function (f) {
		  url.forEach(function(item) {
           if (f.innerHTML.match(new RegExp(item, "i"))) {
            // alert(f.innerHTML);
             //f.setAttribute("style", "background:#c4df9b;");
			 d.setAttribute('style', 'border:1px solid #c4df9b');
             [].forEach.call(d.getElementsByClassName("flat_button"), function (g) {
					document.getElementById(g.id).focus();
             });                          
           }
		  });
       });

     });
})