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 116651 73bb1c39936345ec43fff094f23c6930084c005a
parent 116650 0248cb0ceeb6885e0b2b391a72199bdba32a0f7a
child 116652 6701cd570f128fe96e9d36177a49cea2e0f57ac7
push id24060
push userpastithas@mozilla.com
push dateFri, 21 Dec 2012 08:30:24 +0000
treeherdermozilla-central@c965fa0804cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs821141
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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