VK OLD STYLE 2.0

VK OLD STYLE

当前为 2021-11-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         VK OLD STYLE 2.0
// @namespace    https://*.vk.com/*
// @version      3.0.0
// @description  VK OLD STYLE
// @author       You
// @match        https://*.vk.com/*
// @include      https://*.vk.com/*
// @icon         https://www.google.com/s2/favicons?domain=vk.com
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @grant        all
// @license MIT
// ==/UserScript==
//  VARS
//console.log(names3);
// ТАЙМЕРЫ
//document.querySelector("head").insertAdjacentHTML("beforeend","<link rel='stylesheet' type='text/css' href='https://dl.dropbox.com/s/xmqh5683r5r6oxb/vk.css' />")
//if (yourname!==null||undefined)

var timer = setInterval(update, 500);
var timer2 = setInterval(update, 5000);
var timer3 = setInterval(changeBgImg,10);
var timer4 = setInterval(ads_remove, 3000);
var timer5 = setInterval(clear,60000);
var timer6 = setInterval(audio,1000);



// ПЕРЕМЕННЫЕ СВЯЗАННЫЕ С КЛАССАМИ
var names2 = document.querySelector('#l_msg a');
var pane = document.querySelector('div.ui_actions_menu_item_panel');
var t5 = document.querySelector('.ui_actions_menu_item_panel');
var t3 = document.querySelector('a.ui_actions_menu_item.im-action.im-action_messenger_settings._im_search_more_action');
var yourname = document.querySelector('a#top_profile_link');
if (yourname!==null||undefined){
yourname = yourname.getAttribute('href');
}








window.onload = function() {
    setTimeout(() => { ads_remove(); }, 500);
    setInterval(ads_remove, 3000);
    setInterval(clear,60000);
    setInterval(titl,1000);
    names2.addEventListener("click", settings_update, false);
    main();
    console.log('Чё ты хотел тут увидеть?');
    fix_name();
    important2();
    //fixvideo();
    setInterval(fixvideo,1000);
    setInterval(upd2,1000);
};
window.onfocus = function(){
set();
};
window.onblur = function(){
end();
};
function set(){
main();
}




function main(){
setInterval(changeBgImg,10);
setInterval(ads_remove, 3000);
setInterval(clear,60000);
setInterval(dot,1000);
setInterval(de,1000);
setInterval(audio,1000);
}

function end(){
clearInterval(timer3);
clearInterval(timer4);
clearInterval(timer5);
clearInterval(timer6);
}
function update(){
var create,title,title2,title3,side,video

if (window.location.pathname == '/' || window.location.pathname == '/edit'){
title = document.querySelector('header.ProfileEditorVkconnect__header')
title2 = document.querySelector('p.ProfileEditorVkconnect__text')
title3 = document.querySelector('a.flat_button[href="https://id.vk.com/account/"]')
  // console.log(title3)
    if (title.textContent == 'Редактирование доступно в VK ID'){
        title.textContent = 'Ваши данные перенесены в VK Connect'
    }
    if (title2.textContent == 'Изменять основную информацию можно в настройках единого аккаунта'){
        title2.textContent = 'Редактирование информации доступно в настройках единого аккаунта'
        title3.innerHTML = 'Перейти в VK Connect'
        title3.href = 'https://connect.vk.com/account/'
    }
//console.log(title)
}
if (window.location.pathname == '/' || window.location.pathname == '/im')
{
// Это главная страница
    if (t5 = document.querySelector('.ui_actions_menu_item_panel')){
    clearInterval(timer);
    setInterval(timer2);
    setInterval(upd,100)
    }
    else{
    settings_update();
    clearInterval(timer);
    setInterval(timer2);
    setInterval(upd,100)
    }
}
if (yourname!==null||undefined){
if (document.location.href == yourname)
{
    dot();
}}}
function upd2(){
test_f();
var mvhref,side,url,с,h,h1
mvhref = document.querySelector('[data-title="Мои видео"]')
side = document.querySelector('div#side_bar')
url = window.location.href
h = document.querySelector('._video_item.video_can_add.VideoCard.VideoCard--movie.video_item')
h1 = document.querySelector('div#video_all_listvideo_all_list')
if (mvhref){
if (window.location =='https://vk.com/video'||window.location == mvhref.href&&window.location =='https://vk.com/video'||window.location == mvhref.href||url.includes('video')== true){
if (!h1){
setTimeout(() => { twof(); }, 500);
h1 = document.querySelector('._video_item.video_can_delete.video_can_edit_albums.VideoCard.VideoCard--movie')
}
if (!h&&!h1){
setTimeout(() => { onef(); }, 500);
h = document.querySelector('._video_item.video_can_add.VideoCard.VideoCard--movie.video_item')
}}}}

function onef(){
var one,two,thr,h9,fo,h10
one = document.querySelector('div#video_subtab_pane_type_trends')
two = document.querySelector('div#video_type_trends_list')
thr = document.querySelectorAll('._video_item.video_can_add.VideoCard.VideoCard--movie')

one.classList = 'video_subtab_pane ge_video_pane video_subtab_pane_all';
one.id = 'video_subtab_pane_all';
two.classList = 'video_items_list _video_list_my_all _video_all_list';
two.id = 'video_all_list';
two.style.position = 'relative';
for (h9 = 0; h9 < thr.length; h9++) {
    thr[h9].classList.add("video_item")
    thr[h9].classList.add("_video_item")
}
for (h10 = 0; h10 < thr.length; h10++) {
    thr[h10].classList.add("video_item")
    thr[h10].classList.add("_video_item")
}
}
function twof(){
var o,t,f,v
o = document.querySelector('div#video_subtab_pane_all')
t = document.querySelector('div#video_all_list')
f = document.querySelectorAll('._video_item.video_can_delete.video_can_edit_albums.VideoCard.VideoCard--movie')

o.classList = 'video_subtab_pane ge_video_pane video_subtab_pane_all';
t.classList = 'video_items_list _video_list_my_all _video_all_list';
t.id = t.id+'video_all_list';
//console.log(f)
for (v = 0; v < f.length; v++) {
    f[v].classList.add("video_item")
    f[v].classList.add("_video_item")
}
}










function test_f(){
var t2 = document.querySelector('.FCWindow')
if (t2){
var t = t2.style.transform
t2.style.transform = localStorage.getItem('test')
localStorage.setItem('test', t);
}
if (t){
localStorage.setItem('test', t);
console.log(localStorage.getItem('test'))
}}

function fixvideo(){
var mv = document.createElement('div');
var prev = document.querySelectorAll('.VideoLayout__main .page_block_header.clear_fix')
var sidebar = document.querySelector('div#side_bar')
var fakesearch = document.querySelector('div#video_search_input_wrapper')
var mvhref = document.querySelector('[data-title="Мои видео"]')
var header = document.querySelector('div#video_block_header')
var content,vid,input,h,t

// Шапка
mv.innerHTML = '<h2 class="page_block_h2 "> <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="'+mvhref+'" class="ui_tab ui_tab_sel" onclick="return uiTabs.goTab(this, event, 1);"> Мои видео </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" onclick="return VideoUpload.showBox({aid: \'0\', from: \'video\'});">Добавить видео</button><button class="flat_button secondary" id="video_create_live_btn" onclick="VideoUpload.createLiveStream();">Создать трансляцию</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> </h2> </div> <div class="eltt eltt_arrow_size_normal eltt_align_center " id=""> <div class="eltt_arrow_back _eltt_arrow_back"> <div class="eltt_arrow"></div> </div> <div class="eltt_content _eltt_content"><div class="video_search_filters_wrap"> <div id="ui_search_fltr_progress" class="ui_search_fltr_progress fl_r"></div> <div class="ui_search_fltr_label">По длительности</div> <div class="ui_search_fltr_sel"><div id="container5" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="0" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown5" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_4"></ul></div> </div></div></div> <div class="ui_search_fltr_label">По дате</div> <div class="ui_search_fltr_sel"><div id="container6" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="0" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown6" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_5"></ul></div> </div></div></div> <div class="ui_search_fltr_label">Сортировка</div> <div class="ui_search_fltr_sel"><div id="container7" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="-1" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown7" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_6"></ul></div> </div></div></div> <div class="checkbox" id="video_fltr_hd" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Высокое качество</div> <div class="checkbox" id="video_fltr_notsafe" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Без ограничений</div> <div class="checkbox " id="video_fltr_live" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Только трансляции</div> </div></div> </div></div>'
mv.id = 'video_block_headertest_id'
if (mvhref){
if (window.location == mvhref.href){
h = document.querySelector('div#video_block_headertest_id')
if (!h){
header.replaceWith(mv)
h = document.querySelector('div#video_block_headertest_id')
//console.log(h)
}}}
if (window.location=='https://vk.com/video'){
mv.innerHTML = '<h2 class="page_block_h2 "> <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="'+mvhref+'" class="ui_tab" onclick="return uiTabs.goTab(this, event, 1);"> Мои видео </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="return VideoUpload.showBox({aid: \'0\', from: \'video\'});">Добавить видео</button><button class="flat_button secondary" id="video_create_live_btn" onclick="VideoUpload.createLiveStream();">Создать трансляцию</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> </h2> </div> <div class="eltt eltt_arrow_size_normal eltt_align_center " id=""> <div class="eltt_arrow_back _eltt_arrow_back"> <div class="eltt_arrow"></div> </div> <div class="eltt_content _eltt_content"><div class="video_search_filters_wrap"> <div id="ui_search_fltr_progress" class="ui_search_fltr_progress fl_r"></div> <div class="ui_search_fltr_label">По длительности</div> <div class="ui_search_fltr_sel"><div id="container5" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="0" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown5" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_4"></ul></div> </div></div></div> <div class="ui_search_fltr_label">По дате</div> <div class="ui_search_fltr_sel"><div id="container6" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="0" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown6" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_5"></ul></div> </div></div></div> <div class="ui_search_fltr_label">Сортировка</div> <div class="ui_search_fltr_sel"><div id="container7" class="selector_container dropdown_container big limited_height" style="width: 200px;"><table cellspacing="0" cellpadding="0" class="selector_table"> <tbody><tr> <td class="selector"> <div class="placeholder_wrap1" style="display: none;"> <div class="placeholder_wrap2"> <div class="placeholder_content" aria-hidden="true" style="color: rgb(124, 127, 130);"></div> <div class="placeholder_cover"></div> </div> </div><div class="selected_items_wrap"><div class="scroll_fader_top"></div> <span class="selected_items"></span> <div class="scroll_fader_bottom"></div></div> <input type="text" class="selector_input selected" readonly="true" style="width: 163px;"> <input type="hidden" name="selectedItems" id="selectedItems" value="-1" class="resultField"> <input type="hidden" name="selectedItems_custom" id="selectedItems_custom" value="" class="customField"> </td><td id="dropdown7" class="selector_dropdown" role="button" aria-hidden="true" style="width: 26px;">&nbsp;</td> </tr> </tbody></table> <div class="results_container"> <div class="result_list dividing_line" style="display: none; opacity: 1; width: 200px;"><ul id="list_options_container_6"></ul></div> </div></div></div> <div class="checkbox" id="video_fltr_hd" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Высокое качество</div> <div class="checkbox" id="video_fltr_notsafe" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Без ограничений</div> <div class="checkbox " id="video_fltr_live" onclick="return checkbox(this);" role="checkbox" aria-checked="false" tabindex="0"><div></div>Только трансляции</div> </div></div> </div></div>'
mv.id = 'video_block_headertest_id'
h = document.querySelector('div#video_block_headertest_id')
if (!h){
header.replaceWith(mv)
h = document.querySelector('div#video_block_headertest_id')
//alert('1')
//console.log(mv)
}}
vid = document.querySelector('.video_block_layout.VideoLayout__contentsWrapper')
content = document.querySelector('div#video_search_input_wrapper')
if (vid){
if (!t){
vid.insertAdjacentElement('beforeBegin', content);
}}

// Перенос поиска
input = 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 (input){
t = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.ui_search_btn_large._wrap._t')
if (!t){
input.classList = 'ui_search_new ui_search ui_search_field_empty video_search_input ui_search_btn_large _wrap _t'
t = document.querySelector('.ui_search_new.ui_search.ui_search_field_empty.video_search_input.ui_search_btn_large._wrap._t')
 //console.log(t)
}}}

function important2(){
var del = document.querySelectorAll('a.ui_actions_menu_item.im-action.im-action_business_notify._im_search_more_action,a.ui_actions_menu_item.im-action.im-action_favorites._im_search_more_action,a#top_vkconnect_link,.top_profile_sep,.TopNavBtn__profileName');
var e2
    for (e2 = 0; e2 < del.length; e2++) {
    del[e2].remove();
}
}

function none(){
var modal = document.querySelector('h1.ModalHeader__title').textContent;
//console.log(modal)
if (modal=='Настройки мессенджера'){
var n = document.querySelector('.BaseModal')
n.style.display = 'none';
var uv = document.querySelector('label.Settings__switch.vkuiSwitch.vkuiSwitch--vkcom.Switch.Switch--vkcom.vkuiSwitch--sizeY-regular.Switch--sizeY-regular input.vkuiSwitch__self.Switch__self')
uv.click();
if (uv.checked){
var uw = document.getElementById('ubf')
uw.innerHTML = 'Отключить звуковые уведомления';
}else{
uw = document.getElementById('ubf')
uw.textContent = 'Включить звуковые уведомления';
}
}}

function important(){
var create = document.querySelector('.imptfix')
var unread = document.querySelector('a#ui_rmenu_unread');
var impt = document.createElement('a');
var parent = document.querySelector('.page_block.ui_rmenu._im_right_menu.ui_rmenu_pr');
var del = document.querySelectorAll('a.ui_actions_menu_item.im-action.im-action_business_notify._im_search_more_action,a.ui_actions_menu_item.im-action.im-action_favorites._im_search_more_action,a#top_vkconnect_link,.top_profile_sep,.TopNavBtn__profileName');
var biz = document.createElement('a');
var e1

impt.setAttribute('tabindex','0');
impt.setAttribute('role','link');
impt.setAttribute('data-action','favorites');
impt.className='ui_rmenu_item _ui_item_unread imptfix';
impt.innerHTML='Важные сообщения';
impt.href='https://vk.com/im?box=fav';

biz.setAttribute('tabindex','0');
biz.setAttribute('role','link');
biz.setAttribute('data-action','business_notify');
biz.className='ui_rmenu_item _ui_item_unread bizfix';
biz.innerHTML='Бизнес-уведомления';
biz.href='https://vk.com/im?tab=business_notify';


unread.insertAdjacentElement('afterEnd', impt);
var fav = document.querySelector('a.ui_rmenu_item._ui_item_unread.imptfix');
fav.insertAdjacentElement('afterEnd', biz);

for (e1 = 0; e1 < del.length; e1++) {
    del[e1].remove();
}
create = document.querySelector('.imptfix')
}
function upd(){
    var style = document.querySelector('.im-page--header.ui_search._im_dialogs_search');
    var style2 = document.querySelector('div#setfx');
    if (style!=null||undefined){
    if (style2.style.transform !== style.style.transform){
    style2.style.transform = style.style.transform;}}
}

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 audio(){
var audio = document.querySelector('ol li a[href*="audios"]')
if (audio){
audio.href = 'https://vk.com/audio?section=all';
}}


function de(){
var deluser = document.getElementById('page_current_info');
var delimg = document.querySelector('img.page_avatar_img');
if (deluser!==null||undefined){
if (deluser.textContent == 'Страница удалена'){
delimg.src = 'https://dl.dropbox.com/s/089xk7q48rve2cl/deactivated_200.gif';
//console.log('test');
}}}

function titl(){
var title =document.title;
var list = document.querySelectorAll('link[rel="icon"], link[rel="shortcut icon"]');
list.forEach(function(element) {
	element.setAttribute('href', 'https://web.archive.org/web/20191213152945im_/https://vk.com/images/icons/favicons/fav_logo.ico?6');
});
if (title =='Мессенджер'){
document.title ='Сообщения';
}
if (title.match('Сообщества')){
document.title ='Группы';
}}
/// ПОНРАВИЛОСЬ



var 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 = [];
        }
    }
};
function sleep(millis) {
    var t = (new Date()).getTime();
    var i = 0;
    while (((new Date()).getTime() - t) < millis) {
        i++;
    }
}


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 + '\')')
        }
    });

/// Очисктка консоли
function clear(){
console.clear();
//console.log('Console cleared');
}
///НАСТРОЙКИ
function settings_update(){
var t = document.querySelector('.im-page--dialogs._im_page_dialogs.page_block');
var t2 = document.querySelector('button.im-page--dialogs-header-control.im-page--dialogs-header-control_call._im_create_call');
var t3 = document.querySelector('a.ui_actions_menu_item.im-action.im-action_messenger_settings._im_search_more_action');
var names = document.querySelector('.top_profile_vkconnect_name');
var jk = document.querySelector('a.ui_rmenu_item._ui_item_unread.imptfix');
var div = document.createElement('div');
var div2 = document.createElement('div');
var a = document.createElement('a');
var a2 = document.createElement('a');
var h2 = document.querySelector('div#setfx');


t3.style.display='none';
//t2.remove();
div.style = 'height:45px;border-top-color:rgb(228, 230, 233);bottom:0px;position:fixed;width:550px;max-width:550px;box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; font-size:12.5px;z-index:102;background-color: rgb(255, 255, 255); border-width: 1px medium medium; border-style: solid none none; padding: 16px 20px; ';
div.id = 'setfx'
a.style = 'color:rgb(42, 88, 133);text-decoration:none;cursor:pointer;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWlBMVEUAAACSormTo7yRobqAn5+ToruTo7ySoruSkraRoLqSo7yRortVVapmmZmTo7uTorySoruToruSoryTorySo7uSorwAAACSoruToruAgICSoryTobySo7ySorvlwXDZAAAAHnRSTlMATf5RCHH/fAdD9o4DBZ6qg/XJ5+a9Ad6ZBJ996I/QAalFAAAAj0lEQVR4AXWQhQGEMAwAgx3uDu3+a37adzuoxRO5EYRhJE9iXQmkemTiyYuyqhtoa+n6XJSsh2FEmWboY1E6XijFsaiSddtWYKi8aJ/g0LjxAWPtsicNrCpR2QpNEkiIsolnQwl/iaKzvTtmK7Spa6K+hc8OMLV4vot4K9X+aygv7K3tRdt+G855G86PEV4AnswInNZD9fcAAAAASUVORK5CYII=");background-color: transparent; width:18px;height:18px;display:block;float:right;-webkit-animation-name:none;-webkit-animation-duration:initial;-webkit-animation-timing-function:initial;-webkit-animation-delay:initial;-webkit-animation-iteration-count:initial;-webkit-animation-direction:initial;-webkit-animation-fill-mode:initial;margin: -3px 0px 14px 14px; ';
a2.style = 'color:rgb(42, 88, 133);text-decoration:none;cursor:pointer;';
a2.innerHTML = 'Отключить звуковые уведомления';
a2.setAttribute('id', 'ubf');

if (jk==null||undefined){
important();
}
if (t !== null||undefined){
//console.log(div);
if (h2 == null||undefined){
t.appendChild(div);
div.appendChild(div2);
div2.appendChild(a);
div2.appendChild(a2);
a2.addEventListener("click", settings, false);
h2 = document.querySelector('div#setfx');
function settings (){
    t3.click();
    none();
}}}}



//ADS
function ads_remove(){
var ads = document.querySelectorAll('[data-ad-view]');
var ads2 = document.querySelectorAll('#ads_left,a#feed_blog_reminder,div#games_catalog_header_content,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_new_apps,div#apps_featured_banner,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_single_app.apps_feedRightAppsBlock_single_app--,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_continue_apps');
var ads3 = document.querySelectorAll('[data-ad],#feed_filters,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_new_apps,#feed_blog_reminder,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_single_app.apps_feedRightAppsBlock_single_app--promo,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_single_app.apps_feedRightAppsBlock_single_app--,.page_block.apps_feedRightAppsBlock.apps_feedRightAppsBlock_new_apps');

var i;
var i2;
//console.log(ads3);
for (i = 0; i < ads.length; i++) {
    ads[i].style.display = "none";
}
for (i2 = 0; i2 < ads2.length; i2++) {
    ads2[i2].style.display = "none";
}}



// LIKES
var i20
function changeBgImg(){
var like_anim_cls = document.querySelectorAll('.PostButtonReactions__icon.PostButtonReactions__icon--custom.PostButtonReactions__icon--animationActive,.PostButtonReactions__icon.PostButtonReactions__icon--custom');
//console.log(like_anim_cls);
for (i20 = 0; i20 < like_anim_cls.length; i20++) {
    like_anim_cls[i20].style.backgroundImage='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 getRandomInRange(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}




// ...
function dot(){
var button = document.querySelector('.page_actions_wide.no_actions .page_action_left');
var div = document.createElement('a');
var area2 = document.querySelectorAll('a.PageActionCell');
var area = document.querySelector('.page_actions_expanded._page_actions_container');
if (document.querySelector('.owner_photo_bubble')){
if (document.querySelector('a.FlatButton.FlatButton--secondary.FlatButton--size-m.FlatButton--wide.dotbtn')){
// Элемент уже создан
}else{
area.classList.toggle("hidden-block");
div.className ='FlatButton FlatButton--secondary FlatButton--size-m FlatButton--wide dotbtn dot';
div.innerHTML = '<span class="FlatButton__in"> <span class="FlatButton__content"></span> </span>';
button.appendChild(div);
div.addEventListener("click",test, false);
if (area[4]){
area2[4].click();
}}}else{
div.remove();
}}
function test(){
var rand
rand = getRandomInRange(0, 4)
switch (rand){
    case 0: alert('Эй!!!');
    break;
    case 1: alert('Зачем ты на меня кликаешь?');
    break;
    case 2:alert('Что ты делаешь?! НЕ КЛИКАЙ НА МЕНЯ');
    break;
    case 3:alert('Тебе больше нечем заняться?');
    break;
    case 4:alert('Отстань от меня!!!');
}
}