VK обозвал группы сообществами, а сообщения - мессенджером. Не беда, ведь есть этот скрипт! Работает для заголовка вкладки и левой панели ссылок
当前为 
// ==UserScript==
// @name         ВКонтакте: исправление новомодных названий меню
// @description  VK обозвал группы сообществами, а сообщения - мессенджером. Не беда, ведь есть этот скрипт! Работает для заголовка вкладки и левой панели ссылок
// @license      MIT
// @namespace    https://gf.qytechs.cn/users/424058
// @version      2.0.0
// @history      2.0.0 Обновлена основа скрипта. Удаление рекламы AliExpress из слов "Скидка", "Распродажа" и т.д.
// @history      1.1.0 "Мессенджер" исправляется на "Сообщения"
// @history      1.0.0 Релиз. Исправление "Сообщества" на "Группы" в левом меню и в заголовке вкладки
// @author       https://vk.me/id222792011
// @match        http*://vk.com/*
// @require      https://gf.qytechs.cn/scripts/415669-observer/code/Observer.js?version=866817
// @run-at       document-start
// @grant        none
// @noframes
// ==/UserScript==
/* jshint esversion: 6 */
(function() {
  'use strict';
  const replaceList = {
    'Сообщества': 'Группы',
    'Мессенджер': 'Сообщения'
  }
  const entities = {
    'tab title': {
      query: 'title',
      subs: {
        'hype names handler': {
          enabled: true,
          scanTypes: {
            DOMchanges: true,
            DOMfirstScan: true
          },
          cb: function(foundNodes) {
            const titleNode = foundNodes[0];
            const thisSub = entities['tab title'].subs['hype names handler'];
            thisSub.enabled = false;
            document.title = fixStringWords(document.title);
            const titleObserver = new MutationObserver(function(mutations, observer) {
              document.title = fixStringWords(document.title);
              observer.takeRecords();
            });
            titleObserver.observe(titleNode, { childList: true });
          }
        }
      }
    },
    'left-menu': {
      query: 'span.left_label.inl_bl',
      subs: {
        'hype names handler': {
          enabled: true,
          scanTypes: {
            DOMchanges: true,
            DOMfirstScan: true
          },
          cb: (foundNodes) => {
            for (let node of foundNodes) {
              node.innerText = fixStringWords(node.innerText);
            }
            const thisSub = entities['left-menu'].subs['hype names handler'];
            thisSub.enabled = false;
          }
        }
      }
    },
    'words highlights': {
      query: '.special_event_highlight',
      subs: {
        'aliexpress spam': {
          // disable after November 15, 2020
          enabled: +new Date() < 1605398400000 ? true : false,
          scanTypes: {
            DOMchanges: true,
            DOMfirstScan: true
          },
          cb: (foundNodes) => {
            for (let node of foundNodes) {
              if (node.dataset.id !== 'aliexpress_1111') { continue }
              node.className = node.className.replace('special_event_highlight', '');
              node.removeAttribute("onclick");
              node.style.color = null;
            }
          }
        }
      }
    }
  }
  const observer = new Observer(document, entities);
  // utils ------------------------------------
  function fixStringWords(str) {
    for (const sought in replaceList) {
      const replaceTo = replaceList[sought];
      str = str.replace(sought, replaceTo);
    }
    return str;
  }
  // ------------------------------------------
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址