Skip to content

Instantly share code, notes, and snippets.

@e0da
Created April 26, 2012 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e0da/2500865 to your computer and use it in GitHub Desktop.
Save e0da/2500865 to your computer and use it in GitHub Desktop.
Remove HTML5 videos from page with a bookmarklet

Make a bookmarklet out of this and you can click it to remove all videos from a page.

javascript:v=document.getElementsByTagName('video');while(v.length>0)v[0].parentNode.removeChild(v[0]);

And here's a permanent user script that will delete them as soon as the page loads

(function () {
  'use strict';
  window.addEventListener('DOMContentLoaded', function () {
    var v = document.getElementsByTagName('video');
    while (v.length > 0) {
      v[0].parentNode.removeChild(v[0]);
    }
  });
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment