您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Вернём старый дизайн вместе
当前为
- // ==UserScript==
- // @name VK By RAM
- // @namespace https://greasyfork.org/ru/scripts/434514-vk-old-style-2-0
- // @version 3.1.4
- // @description Вернём старый дизайн вместе
- // @author RAM
- // @match https://*.vk.com/*
- // @icon https://www.google.com/s2/favicons?domain=vk.com
- // @license MIT
- // @compatible chrome
- // @compatible firefox
- // @compatible opera
- // @compatible safari
- // @compatible edge
- // ==/UserScript==
- var i,i2,vd
- i=0
- i2=0
- vd=0
- window.onload = function() {
- initial();
- };
- window.onblur = function () {
- var a = setInterval(title,2000);
- var b = setInterval(ads,2000);
- var c = setInterval(check,1000);
- clearInterval(a);
- clearInterval(b);
- clearInterval(c);
- }
- window.onfocus = function () {
- setInterval(title,2000);
- setInterval(ads,2000);
- setInterval(check,1000);
- //fix_name();
- }
- function initial(){
- console.log('Скрипт запущен');
- setInterval(title,2000);
- setInterval(ads,2000);
- setInterval(check,1000);
- fix_name();
- }
- // Проверка
- function check(){
- check_vid();
- dot_check();
- feed_check();
- }
- function feed_check(){
- if (window.location.href.includes('feed')){
- _class();
- }
- }
- function _class(){
- KPP.add('.PostButtonReactions', function (reactions) {
- var count = reactions.dataset.reactionCounts;
- if (count && !(reactions.dataset.reactionButtonTextIsCounter)) {
- count = JSON.parse(count);
- if (!Array.isArray(count)) {
- count = Object.values(count)
- }
- var likes = count.reduce(function(previous, current) {
- return previous + current
- })
- reactions.getElementsByClassName('PostButtonReactions__title')[0].textContent = likes;
- }
- reactions.dataset.reactionButtonTextIsCounter = '1';
- var target = reactions.dataset.reactionTargetObject;
- if (target) {
- reactions.setAttribute('onmouseover','Likes.showLikes(this,\'' + target + '\')')
- }
- });
- var u,k
- var old1 = document.querySelectorAll('.like_cont.PostBottomActionLikeBtns.PostBottomActionLikeBtns--withBgButtons')
- for (u = 0; u < old1.length; u++) {
- old1[u].classList= 'like_cont';
- }
- var old2 = document.querySelectorAll('.PostButtonReactions__icon.PostButtonReactions__icon--custom.PostButtonReactions__icon--animationActive')
- for (k = 0;k<old2.length;k++){
- old2[k].style.background=`background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m0%200h24v24h-24z%22%20fill%3D%22none%22%2F%3E%3Cpath%20d%3D%22m17%202.9a6.43%206.43%200%200%201%206.4%206.43c0%203.57-1.43%205.36-7.45%2010l-2.78%202.16a1.9%201.9%200%200%201%20-2.33%200l-2.79-2.12c-6.05-4.68-7.45-6.47-7.45-10.04a6.43%206.43%200%200%201%206.4-6.43%205.7%205.7%200%200%201%205%203.1%205.7%205.7%200%200%201%205-3.1z%22%20fill%3D%22%23ff3347%22%2F%3E%3C%2Fsvg%3E);`
- }
- }
- // Название
- function title(){
- var title
- title = document.querySelector('title')
- if (title.textContent=='Мессенджер'){
- title.textContent = 'Сообщения'
- }
- }
- // Реклама
- function ads(){
- var ad_blocks,a
- ad_blocks = document.querySelectorAll('div#ads_left,[data-ad-view],div#games_catalog_header_content,.videoplayer_ads._overlay_hidden');
- for (a = 0; a < ad_blocks.length; a++) {
- ad_blocks[a].outerHTML= '';
- }}
- // Три точки проверка
- function dot_check(){
- var prof
- prof = document.querySelector('a#profile_edit_act[href="edit"]');
- if (prof!==null){
- dot_prof();
- }
- }
- // Три точки установка
- function dot_prof(){
- var aside,button,stats,stats_hash,stats_elem,stats_elem_parent,temp_a,regular_a,story_href,story
- aside = document.querySelector('.page_block.page_photo.ProfileActions>aside');
- stats = document.querySelector('[href*="/stats?"]')
- if (stats){
- stats_hash = stats.href
- }
- aside.style.display = 'none';
- aside.outerHTML='<aside aria-label="Действия со страницей" class="profile_aside"><div class="profile_aside_div"> <div class="profile_aside_div_div"> <div class="profile_aside_div_div_div"> <a href="edit" class="profile_aside_div_div_div_a">Редактировать</a> </div> <div class="profile_aside_div_div_div2"> <div aria-label="Действия" role="button" tabindex="0" class="profile_aside_div_div_div2_div"> <span class="profile_aside_div_div_div2_div_span">Действия</span> <span style="display:block;"> </span> </div> <div class="profile_aside_one"> <div class="profile_aside_one_two"> <span class="profile_aside_one_two_three">Действия</span> </div> <div class="profile_aside_four"> <a href="memories" role="link" tabindex="0" class="profile_aside_four_a">Воспоминания</a><a href="" id="aside_story_archive" role="link" class="profile_aside_four_a2" tabindex="0">Архив историй</a><a role="link" tabindex="0" class="profile_aside_four_a2" data-task-click="ProfileAction/money_transfer_box" data-from="own_profile">Денежные переводы</a> </div> </div> </div> <span style="font-size:0px;clear:both;display:block;height: 0px;line-height:0;visibility:hidden;/">.</span></div> </div> </aside>'
- story = document.querySelector('a#aside_story_archive')
- story.href = window.location.pathname + '?w=stories'
- // Если есть статистика добавляем элемент
- if (stats){
- stats_elem_parent = document.querySelector('.profile_aside_four')
- stats_elem = document.createElement('a')
- stats_elem.classList = 'temp_a'
- stats_elem_parent.prepend(stats_elem)
- temp_a = document.querySelector('a.temp_a')
- temp_a.outerHTML = '<a href="" id="aside_stats" role="link" class="profile_aside_four_a2" tabindex="0">Статистика страницы</a>'
- regular_a = document.querySelector('a#aside_stats')
- regular_a.href = stats_hash
- }
- button = document.querySelector('.profile_aside_div_div_div2')
- button.onclick = function() {
- var b
- b = document.querySelector('.profile_aside_div_div_div2')
- b.classList.toggle('atv')
- };
- }
- // Меню и Имя возле иконки
- function fix_name(){
- //console.log('Фикс имени пошёл')
- var parentlnk = document.querySelector('div#top_profile_menu')
- var lnk = document.querySelector('li#l_pr a')
- var setlnk = document.querySelector('a#top_settings_link');
- var suplnk = document.querySelector('a#top_support_link');
- var loglnk = document.querySelector('a#top_logout_link');
- var name = document.querySelector('img.TopNavBtn__profileImg');
- var name2 = document.querySelector('a[href*="connect.vk.com"] div[style="color: var(--text_primary);"]')
- var name3 = document.querySelector('[style="background-color: var(--content_tint_background); border-radius: 8px; width: 254px; font-family: inherit;"]')
- var remove = document.querySelector('a[href*="connect.vk.com"] ')
- var remove2 = document.querySelectorAll('div#top_profile_menu span')
- var namealt = name.alt
- var s = document.querySelector('a#top_profile_link[aria-label="Настройки страницы"]');
- var q = document.createElement('div');
- var w = document.createElement('a');
- var n = document.createElement('a');
- var u = document.createElement('div');
- var k = document.createElement('div');
- var k2 = document.createElement('span');
- var b1
- q.innerHTML = `<div style="padding-right:10px;display:inline-block;vertical-align:top;color:white;font-weight: 500;-webkit-font-smoothing: subpixel-antialiased;">`+namealt+`</div>`;
- w.className = 'top_profile_mrow'
- w.id = 'top_home_link'
- w.href = lnk.href
- n.className = 'top_profile_mrow'
- n.id = 'top_edit_link'
- n.href = '/edit'
- k2.style = 'position:absolute;pointer-events:none;height:0px;width:0px;bottom:100%;right:42px;border-width: 6px; border-style: solid; margin: 0px -6px; border-color: transparent transparent white; " class=""'
- u.innerHTML = '<div style="border-top-color:rgb(219, 228, 236);border-width: 1px medium medium; border-style: solid none none; margin: 4px 13px; "></div>'
- k.innerHTML = '<div style="border-top-color:rgb(219, 228, 236);border-width: 1px medium medium; border-style: solid none none; margin: 4px 13px; "></div>'
- w.innerHTML ='Моя страница'
- n.innerHTML = 'Редактировать'
- setlnk.innerHTML ='Настройки'
- suplnk.innerHTML ='Помощь'
- suplnk.innerHTML ='Помощь'
- loglnk.innerHTML ='Выйти'
- if (namealt!=null){
- s.insertBefore(q,s.firstChild)
- setlnk.insertAdjacentElement('beforeBegin', w);
- var home = document.querySelector('a#top_home_link')
- parentlnk.insertBefore(u,setlnk)
- parentlnk.insertBefore(k,loglnk)
- parentlnk.insertBefore(n,setlnk)
- parentlnk.insertBefore(k2,home)
- for (b1 = 0; b1 < remove2.length; b1++) {
- remove2[b1].remove();
- }}
- //console.log('Фикс прошёл успешно')
- }
- // Фикс в видео
- function check_vid(){
- var h2
- var myvd = document.querySelector('li#l_pr a.left_row')
- var h = myvd.href
- h2 = h.split('vk.com/')[1];
- //console.log(h2)
- if (!window.location.href.includes(h2)&&(!window.location.href.includes('/video/@'))){
- seacrh2();
- pop_vid();
- }
- if (window.location.href.includes(h2)){
- my_vid();
- seacrh();
- }
- if (window.location.href.includes('/video?z=')&&(vd=0)){
- check_vid_ads();
- }
- if (window.location.href.includes('https://vk.com/video/@')&&!window.location.href.includes(h2)){
- seacrh3();
- }
- }
- function seacrh(){
- // Установка старого поиска
- var search = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.VideoSearchInput.ui_search_custom.ui_search_with_custom_controls._wrap')
- if (search){
- search.classList= 'ui_search_new ui_search ui_search_field_empty video_search_input ui_search_btn_large _wrap'
- // Передвижение поиска
- var parent = document.querySelector('div#video_main_block h2.page_block_h2')
- var child = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.ui_search_btn_large._wrap')
- parent.appendChild(child)
- }}
- function seacrh3(){
- var search = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.VideoSearchInput.ui_search_custom.ui_search_with_custom_controls._wrap')
- var header = document.querySelector('div#video_block_header')
- if (search){
- search.classList= 'ui_search_new ui_search ui_search_field_empty video_search_input ui_search_btn_large _wrap'
- header.after(search)
- }
- }
- function my_vid(){
- var head = document.querySelectorAll('.page_block_header.clear_fix')
- if (head[1]){
- head[1].outerHTML = `<ul class="ui_tabs clear_fix ui_tabs_header ui_tabs_with_progress" onmouseover="uiTabs.tryInit(this)" id="video_main_tabs" data-inited="1">
- <li id="videocat_tab_all">
- <a href="#" class="ui_tab ui_tab_sel" onclick="document.querySelector('a.MenuList__item.MenuList__item--expandable').click();">
- Мои видео
- </a>
- </li><li id="videocat_tab_catalog">
- <a href="/video" class="ui_tab" onclick="return uiTabs.goTab(this, event, 1);">
- Видеокаталог
- </a>
- </li><li>
- <div class="ui_tab_plain ui_tabs_progress" role="link">
- </div>
- </li> <button style="margin-left: 0" class="flat_button">Добавить видео</button><button class="flat_button secondary" id="video_create_live_btn">Создать трансляцию</button> <button class="flat_button secondary" id="video_add_album_btn" onclick="return Video.createAlbum(event);" style="">Создать альбом</button>
- <div class="ui_tabs_slider _ui_tabs_slider" style="width: 83.6875px; margin-left: 14px;"></div>
- </ul>`
- var t = document.querySelector('button.flat_button[style="margin-left: 0"]')
- var t2 = document.querySelector('button#video_create_live_btn')
- t.addEventListener("click", add, false);
- t2.addEventListener("click", add1, false);
- }}
- function seacrh2(){
- // Установка старого поиска
- var search = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.VideoSearchInput.ui_search_custom.ui_search_with_custom_controls._wrap')
- if (search){
- search.classList= 'ui_search_new ui_search ui_search_field_empty video_search_input ui_search_btn_large _wrap'
- // Передвижение поиска
- var parent = document.querySelector('.ui_gallery__arrow.ui_gallery__arrow_left')
- var child = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.ui_search_btn_large._wrap')
- parent.before(child)
- }}
- function check_vid_ads(){
- var main_vid = document.querySelector('.videoplayer_media video')
- var ads_vid = document.querySelector('video.videoplayer_ads_media_el')
- if (ads_vid){
- ads_vid.pause();
- main_vid.play();
- //console.log('text')
- vd=1
- }else{
- vd=0
- }
- }
- function pop_vid(){
- var head2 = document.querySelector('ul#video_main_tabs')
- var head = document.createElement('ul')
- head.classList='gg'
- //console.log(head2)
- var slider = document.querySelector('.ui_gallery.VideoTabsSlider.js-video-slider')
- if (slider){
- slider.classList='ui_gallery VideoTabsSlider'
- }
- var search = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.ui_search_btn_large._wrap')
- if (head2==null){
- if (search){
- search.before(head)
- head2 = document.querySelector('ul.gg')
- head2.outerHTML=`<ul class="ui_tabs clear_fix ui_tabs_header ui_tabs_with_progress" onmouseover="uiTabs.tryInit(this)" id="video_main_tabs" data-inited="1">
- <li id="videocat_tab_all">
- <a href="#" class="ui_tab" onclick="document.querySelector('a.MenuList__item.MenuList__item--expandable').click();">
- Мои видео
- </a>
- </li><li id="videocat_tab_catalog">
- <a href="/video" class="ui_tab ui_tab_sel" onclick="return uiTabs.goTab(this, event, 1);">
- Видеокаталог
- </a>
- </li><li>
- <div class="ui_tab_plain ui_tabs_progress" role="link">
- </div>
- </li> <button style="margin-left: 0" class="flat_button" onclick="document.querySelectorAll('.VideoActions__item')[1].click();">Добавить видео</button><button class="flat_button secondary" id="video_create_live_btn" onclick="document.querySelector('.VideoActions__item.VideoActions__item--secondary').click();">Создать трансляцию</button> <button class="flat_button secondary" id="video_add_album_btn" onclick="return Video.createAlbum(event);" style="display: none;">Создать альбом</button>
- <div class="ui_tabs_slider _ui_tabs_slider" style="width: 103.906px; margin-left: 14px; transform: translateX(92px);"></div>
- </ul>`
- head2 = document.querySelector('ul#video_main_tabs')
- }}}
- function add(){
- var h = document.querySelector('.VideoActions__item[aria-label="Добавить видео"]')
- h.click();
- }
- function add1(){
- var h = document.querySelector('.VideoActions__item.VideoActions__item--secondary')
- h.click();
- }
- var KPP
- KPP = {
- _list: [],
- _actions: [],
- _addedTag: function (observer, mutations, tag, callback, once) {
- for (var i = 0, l = mutations.length; i < l; i++) {
- for (var j = 0, m = mutations[i].addedNodes.length; j < m; j++) {
- if (mutations[i].addedNodes[j].tagName === tag) {
- callback();
- if (once) observer.disconnect();
- }
- }
- }
- },
- _police: new MutationObserver(function (mutations) {
- for (var i = 0, l = mutations.length; i < l; i++) {
- for (var j = 0, m = mutations[i].addedNodes.length; j < m; j++) {
- if (mutations[i].addedNodes[j].nodeType === 1) {
- for (var k = KPP._list.length; k--;) {
- if (mutations[i].addedNodes[j].matches(KPP._list[k])) { // Обрабатывает только существующие элементы до DOMContentLoaded
- if (!mutations[i].addedNodes[j].KPPPassed) {
- KPP._actions[k](mutations[i].addedNodes[j]);
- mutations[i].addedNodes[j].KPPPassed = true;
- }
- } else {
- var n = mutations[i].addedNodes[j].querySelectorAll(KPP._list[k]);
- for (var o = 0, p = n.length; o < p; o++) {
- if (!n[o].KPPPassed) {
- KPP._actions[k](n[o]);
- n[o].KPPPassed = true;
- }
- }
- }
- //if (n.length > 0) break
- }
- }
- }
- }
- }),
- head: function (callback) {
- if (!document.head) {
- var observer = new MutationObserver(function (mutations, observer) {
- KPP._addedTag(observer, mutations, 'HEAD', callback, true)
- });
- observer.observe(document.documentElement, {childList: true});
- } else callback();
- },
- body: function (callback) {
- if (!document.body) {
- var observer = new MutationObserver(function (mutations, observer) {
- KPP._addedTag(observer, mutations, 'BODY', callback, true)
- });
- observer.observe(document.documentElement, {childList: true});
- } else callback();
- },
- add: function (selector, callback) {
- var q = document.querySelectorAll(selector);
- if (q.length > 0) {
- for (var i = q.length; i--;) {
- callback(q[i]);
- }
- }
- KPP._list.push(selector);
- KPP._actions.push(callback);
- KPP._police.observe(document.documentElement, {childList: true, subtree: true})
- },
- remove: function (selector) {
- var s = KPP._list.indexOf(selector);
- if (s !== -1) {
- KPP._list.splice(s, 1);
- KPP._actions.splice(s, 1);
- if (KPP._list.length < 1)
- KPP._police.disconnect();
- return true
- }
- return false
- },
- stop: function (full) {
- KPP._police.disconnect();
- if (full) {
- KPP._list = [];
- KPP._actions = [];
- }
- }
- };