Permalink
Browse files

trapping URIs

  • Loading branch information...
1 parent ac1106d commit d1c04fcef50283cad727e10e30b7082c52e08c3a @tarik-personal tarik-personal committed Apr 11, 2012
Showing with 27 additions and 1 deletion.
  1. +27 −1 content/overlay.js
View
@@ -5,9 +5,35 @@ var Zogger = {
},
onMenuItemCommand: function() {
- logObject2Console(console);
gBrowser.loadOneTab("chrome://zogger/content/zogger-report.xul");
}
};
+var httpRequestObserver =
+{
+ observe: function(subject, topic, data)
+ {
+ if (topic == "http-on-modify-request") {
+ var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
+ logObject2Console(httpChannel.originalURI);
+ }
+ },
+
+ get observerService() {
+ return Components.classes["@mozilla.org/observer-service;1"]
+ .getService(Components.interfaces.nsIObserverService);
+ },
+
+ register: function()
+ {
+ this.observerService.addObserver(this, "http-on-modify-request", false);
+ },
+
+ unregister: function()
+ {
+ this.observerService.removeObserver(this, "http-on-modify-request");
+ }
+};
+
window.addEventListener("load", function(e) { Zogger.onLoad(e); }, false);
+httpRequestObserver.register();

0 comments on commit d1c04fc

Please sign in to comment.