Skip to content

Instantly share code, notes, and snippets.

@beckyconning
Created November 15, 2012 04:48
Show Gist options
  • Save beckyconning/4076726 to your computer and use it in GitHub Desktop.
Save beckyconning/4076726 to your computer and use it in GitHub Desktop.
goToURLWithoutFirstOfClass=function(a,b){var c=fullWindowIframeWithURL(a);coverUpElement=document.body.appendChild(documentSizeForegroundWhiteDiv());c.onload=function(d){removeFirstOfClassFromPage(a,b);c.contentDocument.body.style.backgroundColor="#ffffff";coverUpElement.parentNode.removeChild(coverUpElement)};document.body.appendChild(c)};fullWindowIframeWithURL=function(a){iframeElement=document.createElement("IFRAME");iframeElement.setAttribute("src",a);iframeElement.style.width="100%";iframeElement.style.height="100%";iframeElement.style.position="absolute";iframeElement.style.top=0;iframeElement.style.left=0;iframeElement.style.zIndex="9999";return iframeElement};documentSizeForegroundWhiteDiv=function(){var a=document.createElement("div");a.style.width="100%";a.style.height="100%";a.style.position="absolute";a.style.backgroundColor="#ffffff";a.style.top=0;a.style.left=0;a.style.zIndex=99999;return a};removeCoverUpElement=function(){coverUpElement.parentNode.removeChild(coverUpElement)};removeFirstOfClassFromPage=function(a,c){var b=iframeElement.contentDocument.getElementsByClassName(c)[0];b.innerHTML=""};goToURLWithoutFirstOfClass("http://www.avaaz.org/en/petition/Tesco_selling_live_packaged_turtles_in_their_supermarkets/","video");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment