Skip to content

Instantly share code, notes, and snippets.

@walski
Created June 6, 2012 05:26
Show Gist options
  • Save walski/2880069 to your computer and use it in GitHub Desktop.
Save walski/2880069 to your computer and use it in GitHub Desktop.
Spiegel Online Ad Remover
// ==UserScript==
// @name Spiegel Online Video Smasher
// @match http://www.spiegel.de/*
// @version 1.0
// ==/UserScript==
// From http://stackoverflow.com/questions/2588513
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})};
// Run the script within the original window to have access to jQuery
execute(function() {
jQuery(function() {
var player = jQuery('#spVideoElements');
if (player.length > 0) {
var videoTag = $('<video controls></video>');
videoTag.attr('src', '/video/media/video-' + spMetadataAssetId + '.html')
videoTag.width(player.width())
videoTag.height(player.height())
player.replaceWith(videoTag)
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment