@@ -281,6 +281,14 @@ export class Catch {
281
281
}
282
282
}
283
283
284
+ private static groupSimilarReports ( value : string ) : string {
285
+ return value
286
+ . replace ( / c h r o m e - e x t e n s i o n : \/ \/ [ ^ \/ ] + \/ / , 'chrome-extension://EXTENSION_ID/' )
287
+ . replace ( / h t t p s : \/ \/ w w w \. g o o g l e a p i s \. c o m \/ g m a i l \/ v 1 \/ u s e r s \/ m e \/ t h r e a d s \/ [ ^ \/ ] + / , 'https://www.googleapis.com/gmail/v1/users/me/threads/THREAD_ID' )
288
+ . replace ( / h t t p s : \/ \/ w w w \. g o o g l e a p i s \. c o m \/ g m a i l \/ v 1 \/ u s e r s \/ m e \/ m e s s a g e s \/ [ ^ \/ ] + / , 'https://www.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID' )
289
+ . replace ( / h t t p s : \/ \/ w w w \. g o o g l e a p i s \. c o m \/ g m a i l \/ v 1 \/ u s e r s \/ m e \/ d r a f t s \/ [ ^ \/ ] + / , 'https://www.googleapis.com/gmail/v1/users/me/drafts/DRAFT_ID' ) ;
290
+ }
291
+
284
292
private static formatExceptionForReport ( thrown : unknown , line ?: number , col ?: number ) : ErrorReport {
285
293
if ( ! line || ! col ) {
286
294
const { line : parsedLine , col : parsedCol } = Catch . getErrorLineAndCol ( thrown ) ;
@@ -298,11 +306,11 @@ export class Catch {
298
306
const exception = Catch . formExceptionFromThrown ( thrown ) ;
299
307
return {
300
308
name : exception . name . substring ( 0 , 50 ) ,
301
- message : exception . message . substring ( 0 , 200 ) ,
302
- url : location . href . split ( '?' ) [ 0 ] ,
309
+ message : Catch . groupSimilarReports ( exception . message . substring ( 0 , 200 ) ) ,
310
+ url : Catch . groupSimilarReports ( location . href . split ( '?' ) [ 0 ] ) ,
303
311
line : line || 1 ,
304
312
col : col || 1 ,
305
- trace : exception . stack || '' ,
313
+ trace : Catch . groupSimilarReports ( exception . stack || '' ) ,
306
314
version : VERSION ,
307
315
environment : Catch . RUNTIME_ENVIRONMENT ,
308
316
product : 'web-ext' ,
0 commit comments