document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. const { classes: Cc, interfaces: Ci } = Components;
  2.  
  3. /**
  4.  * oldCompose namespace
  5.  */
  6.  
  7. if (typeof oldCompose == "undefined") {
  8.     var oldCompose =
  9.     {
  10.    // called by addObserver
  11.    QueryInterface: function (iid) {  
  12.       if (iid.equals(Ci.nsIObserver) || iid.equals(Ci.nsISupports))  
  13.         return this;  
  14.            
  15.       throw Cr.NS_ERROR_NO_INTERFACE;
  16.     },
  17.  
  18.         observe: function(subject, topic, data) {
  19.           // Change user agent according to the host
  20.           var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);  
  21.           var host = httpChannel.getRequestHeader("Host").toLowerCase();
  22.          
  23.           if (host.indexOf("mail.google.com") == 0) {
  24.             var agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)";
  25.             httpChannel.setRequestHeader("User-Agent", agent, false);  
  26.           }
  27.         },
  28.        
  29.         install: function() {
  30.       this.observerService =
  31.         Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
  32.            
  33.             this.observerService.addObserver(this, "http-on-modify-request", false);
  34.         },
  35.        
  36.         uninstall: function() {
  37.             this.observerService.removeObserver(this, "http-on-modify-request");
  38.         }
  39.     }
  40. };
  41.  
  42. /**
  43.  * Global event handlers
  44.  */
  45.  
  46. function startup(data, aReason) {
  47.     oldCompose.install();
  48. }
  49.  
  50. function shutdown(data, aReason) {
  51.     oldCompose.uninstall();
  52. }
  53.  
  54. function install(data, aReason) {}
  55. function uninstall(data, aReason) {}
');