diff --git a/Resources/code.js b/Resources/code.js
index 1abbf860..df6e2067 100644
--- a/Resources/code.js
+++ b/Resources/code.js
@@ -1,4 +1,4 @@
-(function($,$TD){
+(function($,$TD,TD){
   //
   // Constant: List of valid font size classes.
   //
@@ -58,11 +58,11 @@
     })();
     
     // Force popup notification settings
-    window.TD.controller.notifications.hasNotifications = function(){
+    TD.controller.notifications.hasNotifications = function(){
       return true;
     };
     
-    window.TD.controller.notifications.isPermissionGranted = function(){
+    TD.controller.notifications.isPermissionGranted = function(){
       return true;
     };
     
@@ -70,6 +70,17 @@
     isInitialized = true;
   };
   
+  //
+  // Function: Appends code at the end of a function.
+  //
+  var extendFunction = function(func, extension){
+    return function(){
+      var res = func.apply(this,arguments);
+      extension.apply(this,arguments);
+      return res;
+    };
+  };
+  
   //
   // Function: Registers an observer to a TweetDeck column, which reports new tweets.
   //
@@ -249,4 +260,4 @@
       e.preventDefault();
     }
   });
-})($,$TD);
+})($,$TD,TD);