Bug 1191943 P4 Make webconsole.js compare messages against navigationStart when determining if service worker messages should be shown. r=bgrins
authorBen Kelly <ben@wanderview.com>
Fri, 06 Oct 2017 09:04:55 -0700
changeset 676138 1a5ab89f1a0c216f6f14efc13a8e8092be86e2f4
parent 676137 3d492063a52cefae09ef88d4eaa769772b98107f
child 676139 047092e0d447a04d7d6776a77ecd775fa2a2d792
push id83398
push userbmo:rail@mozilla.com
push dateFri, 06 Oct 2017 17:12:44 +0000
reviewersbgrins
bugs1191943
milestone58.0a1
Bug 1191943 P4 Make webconsole.js compare messages against navigationStart when determining if service worker messages should be shown. r=bgrins
devtools/server/actors/webconsole.js
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -805,26 +805,26 @@ WebConsoleActor.prototype =
       let type = types.shift();
       switch (type) {
         case "ConsoleAPI": {
           if (!this.consoleAPIListener) {
             break;
           }
 
           // See `window` definition. It isn't always a DOM Window.
-          let requestStartTime = this.window && this.window.performance ?
-            this.window.performance.timing.requestStart : 0;
+          let winStartTime = this.window && this.window.performance ?
+            this.window.performance.timing.navigationStart : 0;
 
           let cache = this.consoleAPIListener
                       .getCachedMessages(!this.parentActor.isRootActor);
           cache.forEach((cachedMessage) => {
             // Filter out messages that came from a ServiceWorker but happened
             // before the page was requested.
             if (cachedMessage.innerID === "ServiceWorker" &&
-                requestStartTime > cachedMessage.timeStamp) {
+                winStartTime > cachedMessage.timeStamp) {
               return;
             }
 
             let message = this.prepareConsoleMessageForRemote(cachedMessage);
             message._type = type;
             messages.push(message);
           });
           break;