Skip to content

Commit 251b59c

Browse files
committed
Match on last timestamp found
1 parent 05469ab commit 251b59c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/profile-logic/import/chrome.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,12 @@ async function processTracingEvents(
685685
// timestamp is of profile save instead of profile start, but one can generate a
686686
// more accurate start timestamp through e.g. handling the Chrome DevTools
687687
// Protocol `Profiler.consoleProfileStarted` event.
688-
const timeStampRe = /(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})/;
689-
const match = timeStampRe.exec(profileUrl ?? '');
688+
const timeStampRe = /(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})/g;
689+
let match;
690+
let curMatch;
691+
while ((curMatch = timeStampRe.exec(profileUrl ?? '')) !== null) {
692+
match = curMatch;
693+
}
690694
if (match) {
691695
const dateTimeString = `${match[1]}-${match[2]}-${match[3]}T${match[4]}:${match[5]}:${match[6]}`;
692696
const startTime = new Date(dateTimeString);

0 commit comments

Comments
 (0)