Bug 821141 - Target is firing a navigation event when an anchor is clicked r=paul
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Wed, 19 Dec 2012 11:18:44 +0000
changeset 122222 73bb1c39936345ec43fff094f23c6930084c005a
parent 122221 0248cb0ceeb6885e0b2b391a72199bdba32a0f7a
child 122223 6701cd570f128fe96e9d36177a49cea2e0f57ac7
push idunknown
push userunknown
push dateunknown
reviewerspaul
bugs821141
milestone20.0a1
Bug 821141 - Target is firing a navigation event when an anchor is clicked r=paul
browser/devtools/framework/Target.jsm
--- a/browser/devtools/framework/Target.jsm
+++ b/browser/devtools/framework/Target.jsm
@@ -290,19 +290,20 @@ TabWebProgressListener.prototype = {
       this.target.emit("will-navigate", request);
     }
   },
 
   onProgressChange: function() {},
   onSecurityChange: function() {},
   onStatusChange: function() {},
 
-  onLocationChange: function TwPL_onLocationChange(webProgress) {
-    let window = webProgress.DOMWindow;
-    if (this.target) {
+  onLocationChange: function TwPL_onLocationChange(webProgress, request, URI, flags) {
+    if (this.target &&
+        !(flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
+      let window = webProgress.DOMWindow;
       this.target.emit("navigate", window);
     }
   },
 };
 
 
 /**
  * A WindowTarget represents a page living in a xul window or panel. Generally