From 811a683673e39f6df931349d6b7c9c8390f80182 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Mon, 27 Mar 2017 12:44:09 -0400 Subject: [PATCH] Fix bug where exception tracking can leak fragment --- src/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.html b/src/index.html index 7753d55..eaa047b 100644 --- a/src/index.html +++ b/src/index.html @@ -45,6 +45,9 @@ ga('create', '{{GA_ID}}', 'auto'); window.onerror = function (message, source, lineno, colno, error) { try { + // Some browsers include fragment in source location for errors in + // index.html. + source = source.split('#')[0]; ga('send', 'exception', {exDescription: message + '\n' + source + ': ' + lineno + ',' + colno, exFatal: true});