Last active
January 22, 2020 23:45
-
-
Save howtogeek/6b3ed7d917900229b37e to your computer and use it in GitHub Desktop.
Revisions
-
howtogeek revised this gist
Sep 1, 2015 . 1 changed file with 14 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,31 @@ <script type="text/javascript"> var iframe = document.createElement("iframe"); iframe.height = "1px"; iframe.width = "1px"; iframe.id = "ads-text-iframe"; iframe.src = "/adframe.js"; document.body.appendChild(iframe); var a = [ "In a world free from ads, one font reigns supreme. COMIC SANS!", "Today's ad free site is brought to you by Comic Sans.", "Please enjoy our website free from ads, showcased in regal Comic Sans.", "Achievement Unlocked! You've unlocked AdBlocker. Your reward is Comic Sans.", "Hello Adblock User! You have unlocked a secret font! Unfortunately, it’s Comic Sans.", "Hello Adblock User! You have won 1 free font! Unfortunately, it’s Comic Sans.", "Some things are even worse than ads. Meet Comic Sans.", "One of our fonts got loose and we can't find it. Do you see Comic Sans anywhere?" ]; var amsg = a[Math.floor(Math.random() * a.length)]; setTimeout(function(){ var iframe = document.getElementById("ads-text-iframe"); if(iframe.style.display == "none" || iframe.style.display == "hidden" || iframe.style.visibility == "hidden" || iframe.offsetHeight == 0) { $( "body" ).prepend( '<div style="display:block;padding:4px;background:gold">' + amsg + '</div>' ); $('*').css("font-family","Comic Sans MS"); iframe.remove(); }else{ iframe.remove(); } }, 500); </script> -
howtogeek created this gist
Sep 1, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <script type="text/javascript"> // this is all a hack and requires jQuery var iframe = document.createElement("iframe"); iframe.height = "1px"; iframe.width = "1px"; iframe.id = "ads-text-iframe"; iframe.src = "/adframe.js"; document.body.appendChild(iframe); setTimeout(function(){ var iframe = document.getElementById("ads-text-iframe"); if(iframe.style.display == "none" || iframe.style.display == "hidden" || iframe.style.visibility == "hidden" || iframe.offsetHeight == 0) { $( "body" ).prepend( '<div style="display:block;padding:4px;background:gold">Since we detected you are blocking the ads that pay our bills, we are changing the font to Comic Sans.</div>' ); $('*').css("font-family","Comic Sans MS"); iframe.remove(); }else{ iframe.remove(); } }, 1000); </script>