Advertisement
x7f

Untitled

x7f
May 5th, 2023 (edited)
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Remove Button
  3. // @version      0.1
  4. // @description  добавляет кнопку удалить под окно приложения
  5. // @author       You
  6. // @match        https://vk.com/app*
  7. // @grant        unsafeWindow
  8. // @run-at       document-idle
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.   'use strict';
  13.   const b = document.createElement("button");
  14.   b.style="all: unset; color: var(--text_link); cursor: pointer; font-size: 13px; padding-right: 4px;"
  15.   b.innerText = `Удалить`
  16.   b.onclick=()=>{
  17.     const iframe=document.createElement('iframe')
  18.     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`;
  19.     document.body.append(iframe);
  20.     setTimeout(()=>window.location.reload(),1000)
  21.   };
  22.   const observer = new MutationObserver(()=>{
  23.     const qr = document.body.querySelector("#qr_code_btn");
  24.     if (qr) {
  25.       qr.parentNode.prepend(b)
  26.       qr.remove();
  27.     }
  28.   });
  29.   observer.observe(document.querySelector("#wrap3"), {childList: true, subtree: true});
  30. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement