Email or username:

Password:

Forgot your password?
Top-level
Григорий Клюшников

Вдруг кому пригодится

// ==UserScript==
// @name         VK attachments expander
// @namespace    http://tampermonkey.net/
// @version      2024-07-06
// @description  Autoclicks "show X more" in post attachments
// @author       Grishka
// @match        https://vk.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=vk.com
// @run-at       document-end
// ==/UserScript==

function expandAnySecondaryAttachments(){
    document.querySelectorAll("button.SecondaryAttachmentGroupShowMore").forEach(function(el){
        if(el.__clickedExpand)
            return;
        console.log("clicking on:", el);
        el.click();
        el.__clickedExpand=true;
    });
}

(function() {
    var observer=new MutationObserver(function(list, observer){
        expandAnySecondaryAttachments();
    });
    observer.observe(document.body, {childList: true, subtree: true});
})();

expandAnySecondaryAttachments();
2 comments
HY1P

@grishka@friends.grishka.me Господи, такая жиза...

П.с это tampermoneky?

Григорий Клюшников

HY1P, ага, но по идее они универсальные

Go Up