Skip to content

Commit fdacabd

Browse files
committed
Update logger.js
1 parent 5cdd4b8 commit fdacabd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

live-view/extensions/mobile-console/logger.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,14 @@ let logger = {
315315
// sometimes aren't available in the stack on Safari,
316316
// so we need to get them from the Error object
317317

318+
319+
// replace absolute URLs with relative URLs in stack
320+
321+
// get origin URL
322+
const location = logger.cW.location;
323+
const originURL = location.origin + location.pathname;
324+
const indexURL = originURL + location.search;
325+
318326
let entryURL = error.sourceURL;
319327

320328
// replace index URLs
@@ -323,6 +331,7 @@ let logger = {
323331
// remove absolute URLs' origin
324332
entryURL = entryURL.replaceAll(originURL, '');
325333

334+
326335
// save entry in stack
327336
stack = [entryURL + ':' + error.line + ':' + error.column];
328337

0 commit comments

Comments
 (0)