Look of Disapproval

filed under javascript

I decided to write a really useful Greasemonkey script today. Here it is.

// ==UserScript==
// @name           Look of Disapproval
// @namespace      http://localhost/
// @include        *
// ==/UserScript==

var setTitle = function() {
   if (document.title.indexOf("ಠ_ಠ") != 0) {
      document.title = "ಠ_ಠ " + document.title;
   }
}
window.addEventListener("load", function() {
   titleChange = function() {
      console.log('changed');
      setTimeout(function() {
         setTitle();
      }, 20);
   };

   var target = document.getElementsByTagName('title')[0];
   target.addEventListener('DOMSubtreeModified',titleChange,false);
   setTitle();
}, false);

setTitle();

It works in both Chromium and Firefox, as you'd expect.

Download Look of Disapproval

Related Posts