Last active
March 2, 2022 23:07
-
-
Save rodmcnew/fe5489c9e3081300444c400e6c60bbfa to your computer and use it in GitHub Desktop.
This is a bookmarklet that removes all iframes from the current page. Paste its code into a bookmark URL field. Click the bookmark to remove all iframes. Once started, it also removes newly spawned iframes every 100ms.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:void(function(){setInterval(function(){document.querySelectorAll('iframe').forEach(function(element){console.log('Iframe Killa - Removing Element:', element);element.parentNode.removeChild(element)})},100)}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rod @rodmcnew,with a slight delay i'm back to thank you. The truth is i ended up using your first creation due to stubborn websites like
amazon.com,imdb.com and whatnot respawning those f*ckers all the time 😄
The UserScript actually is coming up nicely,i'm in the final stages but banging my head here how to implement to check first if the page has any iframes at all and if not to quit altogether. For example,this is telling me if there are any or there aren't:
(function() { if (document.querySelector('iframe') == null) console.log("no iframes"); else console.log("iframes exist");}
You mind providing some assistance,anything will be greatly appreciated. If you want i can paste here what i got so far.
Either way,big THANK YOU 👍 Your code is working great 😉