A
A
AlexandraDel2021-11-24 10:37:37
In contact with
AlexandraDel, 2021-11-24 10:37:37

Is it possible to fix the button for saving photos in VK?

FlyVK by flyink13

I didn't find a clickable link. The code for what worked this year is below.
And so it is found here:
https://github.com/FlyInk13
https://vk.com/club115918457

A couple of days ago it worked. I will be very grateful.
I would like such a script separately, very, very convenient.
Plus, they should be attracted to the checkbox, and the photo should be added to the album with saves.

619deba257f13449261930.jpeg
VKFly2 does not work, for some reason I only have the previous version.

// ==UserScript==
// @name FlyVK
// @description Улучшения для ВКонтакте. Подробнее k-94.ru/FlyVK/
// @version     1.81
// @author flyink13

// @include     *://vk.com/*
// @include     *://*.vk.com/*
// @include     *://vk.me/*
// @include     *://*.vk.me/*
// @include     *://vk-cdn.net/*
// @include     *://*.vk-cdn.net/*
// @include     *://userapi.com/*
// @include     *://*.userapi.com/*
// @include     *://*.vk.cc/*
// @include     *://vkuseraudio.net/*
// @include     *://*.vkuseraudio.net/*

// @connect k-94.ru
// @grant GM_setValue
// @grant unsafeWindow
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// @grant GM_listValues

// @copyright 2016, flyink13 (Evgenii Kotliarov k-94.ru)

// @license MIT
// @icon http://k-94.ru/assets/logo.png
// @homepageURL https://k-94.ru/FlyVK/
// @updateURL https://openuserjs.org/meta/flyink13/FlyVK.meta.js
// ==/UserScript==
/* global FlyVK */

//*
// GM_adapter
function injectScript(code) {
    var script = document.createElement('script');
    script.appendChild(document.createTextNode(code));
    (document.body || document.head || document.documentElement).appendChild(script);
    script.outerHTML = '';
    delete script;
}

function GM_adapterWrap(GM_adapterId) {
    window.GM_adapterCallback = {};
    window.GM_adapter = GM_adapter;
    function GM_adapter(command, callback) {
        command.id = Math.random();
        command.aid = GM_adapterId;
        GM_adapterCallback[command.id] = function(response) {
            delete GM_adapterCallback[command.id];
            if (callback) callback(response);
        }
        window.postMessage (command, '*');
    }
}

function GM_adapterCallback(data, response) {
    response = JSON.stringify(response);
    var callback = 'GM_adapterCallback[' + data.id + ']';
    injectScript('(' + callback + ' && ' + callback + '(' + response + '));');
}

var GM_adapterId = Math.random();
injectScript('(' + GM_adapterWrap.toString() + ')(' + GM_adapterId + ')');

window.addEventListener('message', function(event) {
    var data = event.data || {};
    if (data.aid !== GM_adapterId) return;
    console.log(data);
    switch (data.type) {
        case 'GM_xmlhttpRequest':
            GM_xmlhttpRequest ({
                method: 'GET',
                url: data.url,
                onload: function (responseDetails) {
                    GM_adapterCallback(data, responseDetails.responseText);
                }
            });
            break;
        case 'loadScript':
            GM_xmlhttpRequest ({
                method: 'GET',
                url: data.url,
                onload: function (responseDetails) {
                    injectScript(responseDetails.responseText);
                    GM_adapterCallback(data);
                }
            });
            break;
    }
}, false);
// **********

function FlyVKWrap() {
    FlyVK.download = function (a, fn) {
        var link = document.createElement("a");
        link.href = a;

        var iframe = document.createElement("iframe");
        iframe.style.display = "none";
        iframe.onload = function () {
            setTimeout(function () {
                iframe.outerHTML = "";
            }, 15000);
        };
        iframe.src = location.protocol + "//" + link.host + "/#FlyDownload#" + encodeURIComponent(a) + "#" + encodeURIComponent(fn);
        document.body.appendChild(iframe);
    };

    FlyVK.other.addScript = function(url) {
        url = url.replace(/^\/\/k\-94\.ru/, 'https://k-94.ru');
        GM_adapter({
            type: 'loadScript',
            url: url,
        });
    }

    FlyVK.vloader = 1.81;
    FlyVK.settings.load();
};

if (location.hash.indexOf("FlyDownload") == 1) {
  var param = location.hash.split("#");

  var downloadLink = document.createElement("a");
  document.body.appendChild(downloadLink);
  downloadLink.href = decodeURIComponent(param[2]);
  downloadLink.setAttribute("download", decodeURIComponent(param[3]) + ".mp3");
  downloadLink.click();
} else {
    GM_xmlhttpRequest ({
        method: 'GET',
        url: 'https://k-94.ru/FlyVK/general.js?r=' + Math.random(),
        onload: function (responseDetails) {
            injectScript('(window.onFlyVK = ' + FlyVKWrap + ');');
            injectScript(responseDetails.responseText);
        }
    });
}

// */

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question