Skip to content

Instantly share code, notes, and snippets.

@beckyconning
Created November 15, 2012 04:30
Show Gist options
  • Select an option

  • Save beckyconning/4076649 to your computer and use it in GitHub Desktop.

Select an option

Save beckyconning/4076649 to your computer and use it in GitHub Desktop.
javascript:goToURLWithoutFirstOfClass=function(url,className){var iframeElement=fullWindowIframeWithURL(url);coverUpElement=document.body.appendChild(documentSizeForegroundWhiteDiv());iframeElement.onload=function(e){removeFirstOfClassFromPage(url,className);iframeElement.contentDocument.body.style.backgroundColor="#ffffff";coverUpElement.parentNode.removeChild(coverUpElement);};document.body.appendChild(iframeElement);};fullWindowIframeWithURL=function(url){iframeElement=document.createElement("IFRAME");iframeElement.setAttribute('src',url);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 divElement=document.createElement('div');divElement.style.width='100%';divElement.style.height='100%';divElement.style.position='absolute';divElement.style.backgroundColor="#ffffff";divElement.style.top=0;divElement.style.left=0;divElement.style.zIndex=99999;return divElement;};removeCoverUpElement=function(){coverUpElement.parentNode.removeChild(coverUpElement);};removeFirstOfClassFromPage=function(url,className){var element=iframeElement.contentDocument.getElementsByClassName(className)[0];element.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