Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Remove Button
- // @version 0.1
- // @description добавляет кнопку удалить под окно приложения
- // @author You
- // @match https://vk.com/app*
- // @grant unsafeWindow
- // @run-at document-idle
- // ==/UserScript==
- (function() {
- 'use strict';
- const b = document.createElement("button");
- b.style="all: unset; color: var(--text_link); cursor: pointer; font-size: 13px; padding-right: 4px;"
- b.innerText = `Удалить`
- b.onclick=()=>{
- const iframe=document.createElement('iframe')
- iframe.src=`https://m.vk.com/apps?act=vkapps_quit&app_id=${unsafeWindow.cur.aid}&quit=1&hash=${unsafeWindow.cur.app.options.hash}&from=app`;
- document.body.append(iframe);
- setTimeout(()=>window.location.reload(),1000)
- };
- const observer = new MutationObserver(()=>{
- const qr = document.body.querySelector("#qr_code_btn");
- if (qr) {
- qr.parentNode.prepend(b)
- qr.remove();
- }
- });
- observer.observe(document.querySelector("#wrap3"), {childList: true, subtree: true});
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement