Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

JoeSimmons

By: a guest on Nov 13th, 2009  |  syntax: JavaScript  |  size: 2.00 KB  |  hits: 329  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. // ==UserScript==
  2. // @name           Mask Embarrassing Tab Titles
  3. // @namespace      http://userscripts.org/users/42648
  4. // @description    Changes the tab title from something embarrassing to something more innocuous.
  5. // @include Add sites to be masked here.
  6. // ==/UserScript==
  7.  
  8. var fakesites = <><![CDATA[
  9. Google
  10. Amazon.com: Online Shopping for Electronics Apparel
  11. PortableApps.com - Portable software for USB drives
  12. Welcome to StumbleUpon
  13. Newegg.com - Computer Parts PC Components Laptop
  14. HowStuffWorks - Learn How Everything Works!
  15. MySQL :: Developer Zone
  16. Dictionary.com | Find the Meanings and Definitions of Words at Dictionary.com
  17. Mozilla.org - Home of the Mozilla Project
  18. YouTube - Broadcast Yourself.
  19. Wikipedia the free encyclopedia
  20. The Internet Movie Database (IMDb)
  21. Hulu - Watch your favorites. Anytime. For free.
  22. Add-ons for Firefox
  23. Digital Blasphemy 3D Wallpaper
  24. ]]></>.toString();
  25.  
  26. var fakefavicons = <><![CDATA[
  27. http://www.google.com
  28. http://www.amazon.com
  29. http://www.portableapps.com
  30. http://www.stumbleupon.com
  31. http://www.newegg.com
  32. http://www.howstuffworks.com/
  33. http://dev.mysql.com/
  34. http://dictionary.reference.com/
  35. http://www.mozilla.org/
  36. http://www.youtube.com/
  37. http://en.wikipedia.org/wiki/Main_Page
  38. http://www.imdb.com
  39. http://www.hulu.com/
  40. https://addons.mozilla.org/en-US/firefox/
  41. https://www.digitalblasphemy.com
  42. ]]></>.toString();
  43.  
  44.  
  45.  
  46. var trim=/^\n+|\n+$/g;
  47. fakesites=fakesites.replace(trim,"").split("\n");
  48. fakefavicons=fakefavicons.replace(trim,"").split("\n");
  49. var picker = Math.floor(Math.random()*(fakesites.length)), head=document.getElementsByTagName('head')[0], onpage=false;
  50.  
  51. document.title = fakesites[picker];
  52.  
  53. var ico=document.evaluate("//link[@rel='icon' and @href]", document, null, 9, null).singleNodeValue;
  54. if(ico) onpage=true;
  55. else ico=document.createElement("link");
  56. ico.setAttribute("rel", "icon");
  57. ico.setAttribute("href", "http://www.google.com/s2/favicons?domain_url="+fakefavicons[picker]);
  58. if(!onpage) head.insertBefore(ico, head.firstChild);