Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://*.instagram.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const callback = function(mutationsList, observer) {
  15. mutationsList.forEach(function(mutation) {
  16. if (mutation.addedNodes && mutation.addedNodes.length > 0) {
  17. const modalThing = [].find.call(mutation.addedNodes, function(el) {
  18. console.log(el);
  19. return el.getAttribute('role') === 'presentation';
  20. });
  21. if (modalThing) {
  22. modalThing.remove();
  23. document.body.style["overflow"] = 'inherit';
  24. setTimeout(function() {document.body.style["overflow"] = 'inherit';}, 400); }
  25. }
  26. });
  27. }
  28.  
  29. new MutationObserver(callback).observe(document.body, {attributes: true, childList: true, characterData: true});
  30.  
  31. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement