Skip to content

Instantly share code, notes, and snippets.

@rodmcnew
rodmcnew / iframe-killa.js
Last active March 2, 2022 23:07
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.
javascript:void(function(){setInterval(function(){document.querySelectorAll('iframe').forEach(function(element){console.log('Iframe Killa - Removing Element:', element);element.parentNode.removeChild(element)})},100)}());
(function() {
var CLASS = 'hide-images';
var STYLE = 'html body,html body *,html body *::before,html body *::after { background-image: none !important; } html body img, html body svg, html body video, html body iframe { opacity: 0.02 !important; }';
var block = document.querySelector('.' + CLASS);
// add/remove style block to override images
if (block) block.remove();
else {
block = document.createElement('style');
block.className = CLASS;