Bug 1640641 - Add `resourceType` attribute to each resource and emit list of resources. r=nchevobbe,jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 29 May 2020 06:29:40 +0000
changeset 532889 2ea5446878716fe02bb5624a2740d7c82f8de13e
parent 532888 673c9f2383158da705051108188958a42b777cb4
child 532890 937c810d3a146248c0f3c7d08b46a2b5019a9639
push id37459
push userrgurzau@mozilla.com
push dateFri, 29 May 2020 09:54:26 +0000
treeherdermozilla-central@2ea544687871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, jdescottes
bugs1640641
milestone78.0a1
first release with
nightly linux32
2ea544687871 / 78.0a1 / 20200529095426 / files
nightly linux64
2ea544687871 / 78.0a1 / 20200529095426 / files
nightly mac
2ea544687871 / 78.0a1 / 20200529095426 / files
nightly win32
2ea544687871 / 78.0a1 / 20200529095426 / files
nightly win64
2ea544687871 / 78.0a1 / 20200529095426 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1640641 - Add `resourceType` attribute to each resource and emit list of resources. r=nchevobbe,jdescottes Differential Revision: https://phabricator.services.mozilla.com/D76672
devtools/client/webconsole/test/node/components/console-api-call.log-messages.test.js
devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js
devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js
devtools/client/webconsole/test/node/fixtures/stubs/pageError.js
devtools/shared/resources/legacy-listeners/console-messages.js
devtools/shared/resources/legacy-listeners/error-messages.js
devtools/shared/resources/legacy-listeners/platform-messages.js
devtools/shared/resources/legacy-listeners/root-node.js
devtools/shared/resources/resource-watcher.js
--- a/devtools/client/webconsole/test/node/components/console-api-call.log-messages.test.js
+++ b/devtools/client/webconsole/test/node/components/console-api-call.log-messages.test.js
@@ -50,29 +50,29 @@ describe("ConsoleAPICall component:", ()
       expect(wrapper.find(".message-body").text()).toInclude(initialText);
     });
   });
 });
 
 // Stub packet
 const logMessageStubPacket = {
   from: "server1.conn0.consoleActor2",
-  resourceType: "platform-messages",
+  resourceType: "platform-message",
   message: "foobar test",
   timeStamp: 1519052480060,
 };
 
 const multilineFullText = `a\n${Array(20000)
   .fill("a")
   .join("")}`;
 const fullTextLength = multilineFullText.length;
 const initialText = multilineFullText.substring(0, 10000);
 const logMessageLongStringStubPacket = {
   from: "server1.conn0.consoleActor2",
-  resourceType: "platform-messages",
+  resourceType: "platform-message",
   message: {
     type: "longString",
     initial: initialText,
     length: fullTextLength,
     actor: "server1.conn1.child1/longString58",
   },
   timeStamp: 1519052480060,
 };
--- a/devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js
+++ b/devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js
@@ -37,17 +37,18 @@ rawPackets.set(`console.log('foobar', 't
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log(undefined)`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "type": "undefined"
@@ -65,17 +66,18 @@ rawPackets.set(`console.log(undefined)`,
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.warn('danger, will robinson!')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "danger, will robinson!"
     ],
@@ -91,17 +93,18 @@ rawPackets.set(`console.warn('danger, wi
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log(NaN)`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "type": "NaN"
@@ -119,17 +122,18 @@ rawPackets.set(`console.log(NaN)`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log(null)`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "type": "null"
@@ -147,17 +151,18 @@ rawPackets.set(`console.log(null)`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('鼬')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "鼬"
     ],
@@ -173,17 +178,18 @@ rawPackets.set(`console.log('鼬')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.clear()`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 35,
@@ -197,17 +203,18 @@ rawPackets.set(`console.clear()`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -226,17 +233,18 @@ rawPackets.set(`console.count('bar')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.assert(false, {message: 'foobar'})`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "_grip": {
@@ -287,17 +295,18 @@ rawPackets.set(`console.assert(false, {m
         "functionName": "triggerPacket",
         "lineNumber": 1,
         "sourceId": "server0.conn0.child1/source30"
       }
     ],
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('úṇĩçödê țĕșť')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "úṇĩçödê țĕșť"
     ],
@@ -313,17 +322,18 @@ rawPackets.set(`console.log('úṇĩçödê țĕșť')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.dirxml(window)`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "_grip": {
@@ -354,17 +364,18 @@ rawPackets.set(`console.dirxml(window)`,
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('myarray', ['red', 'green', 'blue'])`, {
   "message": {
     "addonId": "",
     "arguments": [
       "myarray",
       {
@@ -401,17 +412,18 @@ rawPackets.set(`console.log('myarray', [
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('myregex', /a.b.c/)`, {
   "message": {
     "addonId": "",
     "arguments": [
       "myregex",
       {
@@ -440,17 +452,18 @@ rawPackets.set(`console.log('myregex', /
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.table(['red', 'green', 'blue']);`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "_grip": {
@@ -498,17 +511,18 @@ rawPackets.set(`console.table(['red', 'g
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});`, {
   "message": {
     "addonId": "",
     "arguments": [
       "myobject",
       {
@@ -563,17 +577,18 @@ rawPackets.set(`console.log('myobject', 
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.debug('debug message');`, {
   "message": {
     "addonId": "",
     "arguments": [
       "debug message"
     ],
@@ -589,17 +604,18 @@ rawPackets.set(`console.debug('debug mes
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.info('info message');`, {
   "message": {
     "addonId": "",
     "arguments": [
       "info message"
     ],
@@ -615,17 +631,18 @@ rawPackets.set(`console.info('info messa
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.error('error message');`, {
   "message": {
     "addonId": "",
     "arguments": [
       "error message"
     ],
@@ -650,17 +667,18 @@ rawPackets.set(`console.error('error mes
         "functionName": "triggerPacket",
         "lineNumber": 1,
         "sourceId": "server0.conn0.child1/source30"
       }
     ],
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('mymap')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "mymap",
       {
@@ -702,17 +720,18 @@ rawPackets.set(`console.log('mymap')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source46",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log('myset')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "myset",
       {
@@ -748,17 +767,18 @@ rawPackets.set(`console.log('myset')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.trace()`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 13,
@@ -795,17 +815,18 @@ rawPackets.set(`console.trace()`, {
         "lineNumber": 9,
         "sourceId": "server0.conn0.child1/source50"
       }
     ],
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.trace('bar', {'foo': 'bar'}, [1,2,3])`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar",
       {
@@ -892,17 +913,18 @@ rawPackets.set(`console.trace('bar', {'f
         "lineNumber": 9,
         "sourceId": "server0.conn0.child1/source50"
       }
     ],
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.time('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -920,17 +942,18 @@ rawPackets.set(`console.time('bar')`, {
     "timeStamp": 1572867483805,
     "timer": {
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`timerAlreadyExists`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -949,17 +972,18 @@ rawPackets.set(`timerAlreadyExists`, {
     "timer": {
       "error": "timerAlreadyExists",
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.timeLog('bar') - 1`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -978,17 +1002,18 @@ rawPackets.set(`console.timeLog('bar') -
     "timer": {
       "duration": 4,
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.timeLog('bar') - 2`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar",
       "second call",
@@ -1035,17 +1060,18 @@ rawPackets.set(`console.timeLog('bar') -
     "timer": {
       "duration": 5,
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.timeEnd('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -1064,17 +1090,18 @@ rawPackets.set(`console.timeEnd('bar')`,
     "timer": {
       "duration": 9,
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`timeEnd.timerDoesntExist`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -1093,17 +1120,18 @@ rawPackets.set(`timeEnd.timerDoesntExist
     "timer": {
       "error": "timerDoesntExist",
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`timeLog.timerDoesntExist`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -1122,17 +1150,18 @@ rawPackets.set(`timeLog.timerDoesntExist
     "timer": {
       "error": "timerDoesntExist",
       "name": "bar"
     },
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.table('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -1148,17 +1177,18 @@ rawPackets.set(`console.table('bar')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.table(['a', 'b', 'c'])`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "_grip": {
@@ -1206,17 +1236,18 @@ rawPackets.set(`console.table(['a', 'b',
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.group('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "bar"
     ],
@@ -1232,17 +1263,18 @@ rawPackets.set(`console.group('bar')`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupEnd('bar')`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1256,17 +1288,18 @@ rawPackets.set(`console.groupEnd('bar')`
     "private": false,
     "sourceId": "server0.conn0.child1/source54",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupCollapsed('foo')`, {
   "message": {
     "addonId": "",
     "arguments": [
       "foo"
     ],
@@ -1282,17 +1315,18 @@ rawPackets.set(`console.groupCollapsed('
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupEnd('foo')`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1306,17 +1340,18 @@ rawPackets.set(`console.groupEnd('foo')`
     "private": false,
     "sourceId": "server0.conn0.child1/source54",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.group()`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1330,17 +1365,18 @@ rawPackets.set(`console.group()`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source48",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupEnd()`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1354,17 +1390,18 @@ rawPackets.set(`console.groupEnd()`, {
     "private": false,
     "sourceId": "server0.conn0.child1/source54",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log(%cfoobar)`, {
   "message": {
     "addonId": "",
     "arguments": [
       "foo",
       "bar"
@@ -1384,17 +1421,18 @@ rawPackets.set(`console.log(%cfoobar)`, 
       "color:blue; font-size:1.3em; background:url('http://example.com/test'); position:absolute; top:10px; ",
       "color:red; line-height: 1.5; background:url('http://example.com/test')"
     ],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log("%cHello%c|%cWorld")`, {
   "message": {
     "addonId": "",
     "arguments": [
       "Hello",
       "|",
@@ -1416,17 +1454,18 @@ rawPackets.set(`console.log("%cHello%c|%
       "",
       "color: blue"
     ],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.group(%cfoo%cbar)`, {
   "message": {
     "addonId": "",
     "arguments": [
       "foo",
       "bar"
@@ -1446,17 +1485,18 @@ rawPackets.set(`console.group(%cfoo%cbar
       "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px",
       "color:red;background:url('http://example.com/test')"
     ],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupEnd(%cfoo%cbar)`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1470,17 +1510,18 @@ rawPackets.set(`console.groupEnd(%cfoo%c
     "private": false,
     "sourceId": "server0.conn0.child1/source54",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupCollapsed(%cfoo%cbaz)`, {
   "message": {
     "addonId": "",
     "arguments": [
       "foo",
       "baz"
@@ -1500,17 +1541,18 @@ rawPackets.set(`console.groupCollapsed(%
       "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px",
       "color:red;background:url('http://example.com/test')"
     ],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.groupEnd(%cfoo%cbaz)`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 11,
@@ -1524,17 +1566,18 @@ rawPackets.set(`console.groupEnd(%cfoo%c
     "private": false,
     "sourceId": "server0.conn0.child1/source54",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.dir({C, M, Y, K})`, {
   "message": {
     "addonId": "",
     "arguments": [
       {
         "_grip": {
@@ -1594,17 +1637,18 @@ rawPackets.set(`console.dir({C, M, Y, K}
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | default: 1`, {
   "message": {
     "addonId": "",
     "arguments": [
       "default"
     ],
@@ -1623,17 +1667,18 @@ rawPackets.set(`console.count | default:
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | default: 2`, {
   "message": {
     "addonId": "",
     "arguments": [
       "default"
     ],
@@ -1652,17 +1697,18 @@ rawPackets.set(`console.count | default:
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | test counter: 1`, {
   "message": {
     "addonId": "",
     "arguments": [
       "test counter"
     ],
@@ -1681,17 +1727,18 @@ rawPackets.set(`console.count | test cou
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | test counter: 2`, {
   "message": {
     "addonId": "",
     "arguments": [
       "test counter"
     ],
@@ -1710,17 +1757,18 @@ rawPackets.set(`console.count | test cou
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | default: 3`, {
   "message": {
     "addonId": "",
     "arguments": [
       "default"
     ],
@@ -1739,17 +1787,18 @@ rawPackets.set(`console.count | default:
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | clear`, {
   "message": {
     "addonId": "",
     "arguments": [],
     "chromeContext": false,
     "columnNumber": 15,
@@ -1763,17 +1812,18 @@ rawPackets.set(`console.count | clear`, 
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | default: 4`, {
   "message": {
     "addonId": "",
     "arguments": [
       "default"
     ],
@@ -1792,17 +1842,18 @@ rawPackets.set(`console.count | default:
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.count | test counter: 3`, {
   "message": {
     "addonId": "",
     "arguments": [
       "test counter"
     ],
@@ -1821,17 +1872,18 @@ rawPackets.set(`console.count | test cou
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.countReset | test counter: 0`, {
   "message": {
     "addonId": "",
     "arguments": [
       "test counter"
     ],
@@ -1850,17 +1902,18 @@ rawPackets.set(`console.countReset | tes
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.countReset | counterDoesntExist`, {
   "message": {
     "addonId": "",
     "arguments": [
       "test counter"
     ],
@@ -1879,17 +1932,18 @@ rawPackets.set(`console.countReset | cou
     "private": false,
     "sourceId": "server0.conn0.child1/source68",
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "styles": [],
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 rawPackets.set(`console.log escaped characters`, {
   "message": {
     "addonId": "",
     "arguments": [
       "hello \nfrom \rthe \"string world!"
     ],
@@ -1905,17 +1959,18 @@ rawPackets.set(`console.log escaped char
     "private": false,
     "sourceId": "server0.conn0.child1/source22",
     "styles": [],
     "timeStamp": 1572867483805,
     "timer": null,
     "workerType": "none",
     "category": "webdev",
     "innerWindowID": 8589934593
-  }
+  },
+  "resourceType": "console-message"
 });
 
 
 const stubPackets = parsePacketsWithFronts(rawPackets);
 
 const stubPreparedMessages = new Map();
 for (const [key, packet] of Array.from(stubPackets.entries())) {
   const transformedPacket = prepareMessage(packet, {
--- a/devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js
+++ b/devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js
@@ -34,17 +34,18 @@ rawPackets.set(`Unknown property ‘such-unknown-property’.  Declaration dropped.`, {
     "error": false,
     "info": false,
     "private": false,
     "stacktrace": null,
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "p",
     "isPromiseRejection": false
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Error in parsing value for ‘padding-top’.  Declaration dropped.`, {
   "pageError": {
     "errorMessage": "Error in parsing value for ‘padding-top’.  Declaration dropped.",
     "errorMessageName": "",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-css-message.html",
     "sourceId": null,
@@ -58,17 +59,18 @@ rawPackets.set(`Error in parsing value for ‘padding-top’.  Declaration dropped.`, {
     "error": false,
     "info": false,
     "private": false,
     "stacktrace": null,
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "p",
     "isPromiseRejection": false
-  }
+  },
+  "resourceType": "error-message"
 });
 
 
 const stubPackets = parsePacketsWithFronts(rawPackets);
 
 const stubPreparedMessages = new Map();
 for (const [key, packet] of Array.from(stubPackets.entries())) {
   const transformedPacket = prepareMessage(packet, {
--- a/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js
+++ b/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js
@@ -101,17 +101,18 @@ rawPackets.set(`ReferenceError: asdf is 
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 3,
           "columnNumber": 5
         }
       },
       "actorID": "server0.conn4.child2/obj25"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`SyntaxError: redeclaration of let a`, {
   "pageError": {
     "errorMessage": "SyntaxError: redeclaration of let a",
     "errorMessageName": "JSMSG_REDECLARED_VAR",
     "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
@@ -181,17 +182,18 @@ rawPackets.set(`SyntaxError: redeclarati
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 2,
           "columnNumber": 9
         }
       },
       "actorID": "server0.conn4.child2/obj26"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`TypeError longString message`, {
   "pageError": {
     "errorMessage": {
       "_grip": {
         "type": "longString",
         "actor": "server0.conn0.child1/longstractor24",
@@ -273,17 +275,18 @@ rawPackets.set(`TypeError longString mes
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 1,
           "columnNumber": 7
         }
       },
       "actorID": "server0.conn4.child2/obj29"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw string with URL`, {
   "pageError": {
     "errorMessage": "uncaught exception: “https://evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is evil and “https://not-so-evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is not good either",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn0.child2/source31",
@@ -329,17 +332,18 @@ rawPackets.set(`throw string with URL`, 
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": "“https://evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is evil and “https://not-so-evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is not good either",
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw ""`, {
   "pageError": {
     "errorMessage": "uncaught exception: ",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -385,17 +389,18 @@ rawPackets.set(`throw ""`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": "",
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw "tomato"`, {
   "pageError": {
     "errorMessage": "uncaught exception: tomato",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -441,17 +446,18 @@ rawPackets.set(`throw "tomato"`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": "tomato",
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw false`, {
   "pageError": {
     "errorMessage": "uncaught exception: false",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source31",
@@ -497,17 +503,18 @@ rawPackets.set(`throw false`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": false,
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw 0`, {
   "pageError": {
     "errorMessage": "uncaught exception: 0",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source31",
@@ -553,17 +560,18 @@ rawPackets.set(`throw 0`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": 0,
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw null`, {
   "pageError": {
     "errorMessage": "uncaught exception: null",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source31",
@@ -611,17 +619,18 @@ rawPackets.set(`throw null`, {
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": {
       "type": "null"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw undefined`, {
   "pageError": {
     "errorMessage": "uncaught exception: undefined",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source31",
@@ -669,17 +678,18 @@ rawPackets.set(`throw undefined`, {
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": {
       "type": "undefined"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw Symbol`, {
   "pageError": {
     "errorMessage": "uncaught exception: Symbol(potato)",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source27",
@@ -729,17 +739,18 @@ rawPackets.set(`throw Symbol`, {
     "cssSelectors": "",
     "isPromiseRejection": false,
     "exception": {
       "type": "symbol",
       "actor": "server0.conn4.child2/symbol38",
       "name": "potato"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw Object`, {
   "pageError": {
     "errorMessage": "uncaught exception: [object Object]",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source31",
@@ -811,17 +822,18 @@ rawPackets.set(`throw Object`, {
           "ownPropertiesLength": 1,
           "ownSymbolsLength": 0,
           "safeGetterValues": {}
         }
       },
       "actorID": "server0.conn4.child2/obj40"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw Error Object`, {
   "pageError": {
     "errorMessage": "Error: pumpkin",
     "errorMessageName": "",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source41",
@@ -887,17 +899,18 @@ rawPackets.set(`throw Error Object`, {
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 1,
           "columnNumber": 7
         }
       },
       "actorID": "server0.conn4.child2/obj42"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`throw Error Object with custom name`, {
   "pageError": {
     "errorMessage": "JuicyError: pineapple",
     "errorMessageName": "",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source43",
@@ -963,17 +976,18 @@ rawPackets.set(`throw Error Object with 
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 2,
           "columnNumber": 15
         }
       },
       "actorID": "server0.conn4.child2/obj44"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject ""`, {
   "pageError": {
     "errorMessage": "uncaught exception: ",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1019,17 +1033,18 @@ rawPackets.set(`Promise reject ""`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": "",
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject "tomato"`, {
   "pageError": {
     "errorMessage": "uncaught exception: tomato",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1075,17 +1090,18 @@ rawPackets.set(`Promise reject "tomato"`
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": "tomato",
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject false`, {
   "pageError": {
     "errorMessage": "uncaught exception: false",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1131,17 +1147,18 @@ rawPackets.set(`Promise reject false`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": false,
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject 0`, {
   "pageError": {
     "errorMessage": "uncaught exception: 0",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1187,17 +1204,18 @@ rawPackets.set(`Promise reject 0`, {
       }
     ],
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": 0,
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject null`, {
   "pageError": {
     "errorMessage": "uncaught exception: null",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1245,17 +1263,18 @@ rawPackets.set(`Promise reject null`, {
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": {
       "type": "null"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject undefined`, {
   "pageError": {
     "errorMessage": "uncaught exception: undefined",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1303,17 +1322,18 @@ rawPackets.set(`Promise reject undefined
     "notes": null,
     "chromeContext": false,
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": {
       "type": "undefined"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject Symbol`, {
   "pageError": {
     "errorMessage": "uncaught exception: Symbol(potato)",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1363,17 +1383,18 @@ rawPackets.set(`Promise reject Symbol`, 
     "cssSelectors": "",
     "isPromiseRejection": true,
     "exception": {
       "type": "symbol",
       "actor": "server0.conn4.child2/symbol52",
       "name": "potato"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject Object`, {
   "pageError": {
     "errorMessage": "uncaught exception: Object",
     "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": null,
@@ -1445,17 +1466,18 @@ rawPackets.set(`Promise reject Object`, 
           "ownPropertiesLength": 1,
           "ownSymbolsLength": 0,
           "safeGetterValues": {}
         }
       },
       "actorID": "server0.conn4.child2/obj54"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject Error Object`, {
   "pageError": {
     "errorMessage": "Error: pumpkin",
     "errorMessageName": "",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source55",
@@ -1521,17 +1543,18 @@ rawPackets.set(`Promise reject Error Obj
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 1,
           "columnNumber": 16
         }
       },
       "actorID": "server0.conn4.child2/obj56"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 rawPackets.set(`Promise reject Error Object with custom name`, {
   "pageError": {
     "errorMessage": "JuicyError: pineapple",
     "errorMessageName": "",
     "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
     "sourceId": "server0.conn4.child2/source57",
@@ -1597,17 +1620,18 @@ rawPackets.set(`Promise reject Error Obj
           "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html",
           "lineNumber": 2,
           "columnNumber": 15
         }
       },
       "actorID": "server0.conn4.child2/obj58"
     },
     "hasException": true
-  }
+  },
+  "resourceType": "error-message"
 });
 
 
 const stubPackets = parsePacketsWithFronts(rawPackets);
 
 const stubPreparedMessages = new Map();
 for (const [key, packet] of Array.from(stubPackets.entries())) {
   const transformedPacket = prepareMessage(packet, {
--- a/devtools/shared/resources/legacy-listeners/console-messages.js
+++ b/devtools/shared/resources/legacy-listeners/console-messages.js
@@ -1,14 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {
+  ResourceWatcher,
+} = require("devtools/shared/resources/resource-watcher");
+
 module.exports = async function({
   targetList,
   targetFront,
   isFissionEnabledOnContentToolbox,
   onAvailable,
 }) {
   // Allow the top level target unconditionnally.
   // Also allow frame, but only in content toolbox, when the fission/content toolbox pref is
@@ -28,25 +32,30 @@ module.exports = async function({
 
   const webConsoleFront = await targetFront.getFront("console");
 
   // Request notifying about new messages
   await webConsoleFront.startListeners(["ConsoleAPI"]);
 
   // Fetch already existing messages
   // /!\ The actor implementation requires to call startListeners(ConsoleAPI) first /!\
-  const { messages } = await webConsoleFront.getCachedMessages(["ConsoleAPI"]);
+  let { messages } = await webConsoleFront.getCachedMessages(["ConsoleAPI"]);
 
-  for (let message of messages) {
+  messages = messages.map(message => {
     // Handling cached messages for servers older than Firefox 78.
+    // Wrap the message into a `message` attribute, to match `consoleAPICall` behavior
     if (message._type) {
-      // Wrap the message into a `message` attribute, to match `consoleAPICall` behavior
-      message = {
+      return {
         message,
-        type: "consoleAPICall",
+        resourceType: ResourceWatcher.TYPES.CONSOLE_MESSAGE,
       };
     }
-    onAvailable(message);
-  }
+    message.resourceType = ResourceWatcher.TYPES.CONSOLE_MESSAGE;
+    return message;
+  });
+  onAvailable(messages);
 
   // Forward new message events
-  webConsoleFront.on("consoleAPICall", onAvailable);
+  webConsoleFront.on("consoleAPICall", message => {
+    message.resourceType = ResourceWatcher.TYPES.CONSOLE_MESSAGE;
+    onAvailable([message]);
+  });
 };
--- a/devtools/shared/resources/legacy-listeners/error-messages.js
+++ b/devtools/shared/resources/legacy-listeners/error-messages.js
@@ -1,14 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {
+  ResourceWatcher,
+} = require("devtools/shared/resources/resource-watcher");
+
 module.exports = async function({
   targetList,
   targetFront,
   isFissionEnabledOnContentToolbox,
   onAvailable,
 }) {
   // Allow the top level target unconditionnally.
   // Also allow frame, but only in content toolbox, when the fission/content toolbox pref is
@@ -31,37 +35,41 @@ module.exports = async function({
   // Request notifying about new messages. Here the "PageError" type start listening for
   // both actual PageErrors (emitted as "pageError" events) as well as LogMessages (
   // emitted as "logMessage" events). This function only set up the listener on the
   // webConsoleFront for "pageError".
   await webConsoleFront.startListeners(["PageError"]);
 
   // Fetch already existing messages
   // /!\ The actor implementation requires to call startListeners("PageError") first /!\
-  const { messages } = await webConsoleFront.getCachedMessages(["PageError"]);
+  let { messages } = await webConsoleFront.getCachedMessages(["PageError"]);
 
-  for (let message of messages) {
-    // On older server (< v77), we're also getting LogMessage cached messages, so we need
-    // to ignore those.
-    if (
-      !webConsoleFront.traits.newCacheStructure &&
-      message._type &&
-      message._type !== "PageError"
-    ) {
-      continue;
-    }
+  // On older server (< v77), we're also getting LogMessage cached messages, so we need
+  // to ignore those.
+  messages = messages.filter(message => {
+    return (
+      webConsoleFront.traits.newCacheStructure ||
+      !message._type ||
+      message._type == "PageError"
+    );
+  });
 
+  messages = messages.map(message => {
     // Handling cached messages for servers older than Firefox 78.
+    // Wrap the message into a `pageError` attribute, to match `pageError` behavior
     if (message._type) {
-      // Wrap the message into a `pageError` attribute, to match `pageError` behavior
-      message = {
+      return {
         pageError: message,
-        type: "pageError",
+        resourceType: ResourceWatcher.TYPES.ERROR_MESSAGE,
       };
     }
+    message.resourceType = ResourceWatcher.TYPES.ERROR_MESSAGE;
+    return message;
+  });
+  // Cached messages don't have the same shape as live messages,
+  // so we need to transform them.
+  onAvailable(messages);
 
-    // Cached messages don't have the same shape as live messages,
-    // so we need to transform them.
-    onAvailable(message);
-  }
-
-  webConsoleFront.on("pageError", onAvailable);
+  webConsoleFront.on("pageError", message => {
+    message.resourceType = ResourceWatcher.TYPES.ERROR_MESSAGE;
+    onAvailable([message]);
+  });
 };
--- a/devtools/shared/resources/legacy-listeners/platform-messages.js
+++ b/devtools/shared/resources/legacy-listeners/platform-messages.js
@@ -1,14 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {
+  ResourceWatcher,
+} = require("devtools/shared/resources/resource-watcher");
+
 module.exports = async function({ targetList, targetFront, onAvailable }) {
   // Only allow the top level target and processes.
   // Frames can be ignored as logMessage are never sent to them anyway.
   // Also ignore workers as they are not supported yet. (see bug 1592584)
   const isAllowed =
     targetFront.isTopLevel ||
     targetFront.targetType === targetList.TYPES.PROCESS;
   if (!isAllowed) {
@@ -22,33 +26,34 @@ module.exports = async function({ target
   // emitted as "logMessage" events). This function only set up the listener on the
   // webConsoleFront for "logMessage".
   await webConsoleFront.startListeners(["PageError"]);
 
   // Fetch already existing messages
   // /!\ The actor implementation requires to call startListeners("PageError") first /!\
   // On older server (< v77), cached messages have to be retrieved at the same time as
   // PageError messages.
-  const { messages } = await webConsoleFront.getCachedMessages([
+  let { messages } = await webConsoleFront.getCachedMessages([
     webConsoleFront.traits.newCacheStructure ? "LogMessage" : "PageError",
   ]);
 
+  // On older server (< v77), we're also getting pageError cached messages, so we need
+  // to ignore those.
+  messages = messages.filter(message => {
+    return (
+      webConsoleFront.traits.newCacheStructure || message._type === "LogMessage"
+    );
+  });
+
   for (const message of messages) {
-    // On older server (< v77), we're also getting pageError cached messages, so we need
-    // to ignore those.
-    if (
-      !webConsoleFront.traits.newCacheStructure &&
-      message._type !== "LogMessage"
-    ) {
-      continue;
-    }
-
     // Handling cached messages for servers older than Firefox 78.
     if (message._type) {
-      message.type = "logMessage";
       delete message._type;
     }
-
-    onAvailable(message);
+    message.resourceType = ResourceWatcher.TYPES.PLATFORM_MESSAGE;
   }
+  onAvailable(messages);
 
-  webConsoleFront.on("logMessage", onAvailable);
+  webConsoleFront.on("logMessage", message => {
+    message.resourceType = ResourceWatcher.TYPES.PLATFORM_MESSAGE;
+    onAvailable([message]);
+  });
 };
--- a/devtools/shared/resources/legacy-listeners/root-node.js
+++ b/devtools/shared/resources/legacy-listeners/root-node.js
@@ -1,14 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {
+  ResourceWatcher,
+} = require("devtools/shared/resources/resource-watcher");
+
 module.exports = async function({ targetList, targetFront, onAvailable }) {
   if (!targetFront.isTopLevel) {
     return;
   }
 
   const inspectorFront = await targetFront.getFront("inspector");
-  await inspectorFront.walker.watchRootNode(onAvailable);
+  await inspectorFront.walker.watchRootNode(node => {
+    node.resourceType = ResourceWatcher.TYPES.ROOT_NODE;
+    return onAvailable([node]);
+  });
 };
--- a/devtools/shared/resources/resource-watcher.js
+++ b/devtools/shared/resources/resource-watcher.js
@@ -195,34 +195,35 @@ class ResourceWatcher {
    * Method called either by:
    * - the backward compatibility code (LegacyListeners)
    * - target actors RDP events
    * whenever an already existing resource is being listed or when a new one
    * has been created.
    *
    * @param {Front} targetFront
    *        The Target Front from which this resource comes from.
-   * @param {String} resourceType
-   *        One string of ResourceWatcher.TYPES, which designes the types of resources
-   *        being reported
-   * @param {json/Front} resource
-   *        Depending on the resource Type, it can be a JSON object or a Front
+   * @param {Array<json/Front>} resources
+   *        Depending on the resource Type, it can be an Array composed of either JSON objects or Fronts,
    *        which describes the resource.
    */
-  _onResourceAvailable(targetFront, resourceType, resource) {
-    // Put the targetFront on the resource for easy retrieval.
-    if (!resource.targetFront) {
-      resource.targetFront = targetFront;
-    }
+  _onResourceAvailable(targetFront, resources) {
+    for (const resource of resources) {
+      // Put the targetFront on the resource for easy retrieval.
+      if (!resource.targetFront) {
+        resource.targetFront = targetFront;
+      }
+      const { resourceType } = resource;
 
-    this._availableListeners.emit(resourceType, {
-      resourceType,
-      targetFront,
-      resource,
-    });
+      this._availableListeners.emit(resourceType, {
+        // XXX: We may want to read resource.resourceType instead of passing this resourceType argument?
+        resourceType,
+        targetFront,
+        resource,
+      });
+    }
   }
 
   /**
    * Called everytime a resource is destroyed in the remote target.
    * See _onResourceAvailable for the argument description.
    *
    * XXX: No usage of this yet. May be useful for the inspector? sources?
    */
@@ -291,21 +292,17 @@ class ResourceWatcher {
     await Promise.all(promises);
   }
 
   /**
    * Call backward compatibility code from `LegacyListeners` in order to listen for a given
    * type of resource from a given target.
    */
   _watchResourcesForTarget(targetFront, resourceType) {
-    const onAvailable = this._onResourceAvailable.bind(
-      this,
-      targetFront,
-      resourceType
-    );
+    const onAvailable = this._onResourceAvailable.bind(this, targetFront);
     return LegacyListeners[resourceType]({
       targetList: this.targetList,
       targetFront,
       isFissionEnabledOnContentToolbox: this.contentToolboxFissionPrefValue,
       onAvailable,
     });
   }
 
@@ -376,14 +373,17 @@ const LegacyListeners = {
     onAvailable,
   }) {
     // DocumentEventsListener of webconsole handles only top level document.
     if (!targetFront.isTopLevel) {
       return;
     }
 
     const webConsoleFront = await targetFront.getFront("console");
-    webConsoleFront.on("documentEvent", onAvailable);
+    webConsoleFront.on("documentEvent", event => {
+      event.resourceType = ResourceWatcher.TYPES.DOCUMENT_EVENT;
+      onAvailable([event]);
+    });
     await webConsoleFront.startListeners(["DocumentEvents"]);
   },
   [ResourceWatcher.TYPES
     .ROOT_NODE]: require("devtools/shared/resources/legacy-listeners/root-node"),
 };