@@ -163,10 +163,12 @@ function meetingRoutines(uiType) {
163163
164164 // Start observing the transcript element and chat messages element for configured mutations
165165 transcriptObserver . observe ( transcriptTargetNode , mutationConfig )
166- } catch ( error ) {
167- console . error ( error )
166+ } catch ( err ) {
167+ console . error ( err )
168168 isTranscriptDomErrorCaptured = true
169169 showNotification ( extensionStatusJSON_bug )
170+
171+ logError ( err )
170172 }
171173
172174 // **** REGISTER CHAT MESSAGES LISTENER **** //
@@ -186,15 +188,19 @@ function meetingRoutines(uiType) {
186188 chatMessagesObserver = new MutationObserver ( chatMessagesMutationCallback )
187189
188190 chatMessagesObserver . observe ( chatMessagesTargetNode , mutationConfig )
189- } catch ( error ) {
190- console . error ( error )
191+ } catch ( err ) {
192+ console . error ( err )
191193 showNotification ( extensionStatusJSON_bug )
194+
195+ logError ( err )
192196 }
193197 } , 1000 )
194- } catch ( error ) {
195- console . error ( error )
198+ } catch ( err ) {
199+ console . error ( err )
196200 isChatMessagesDomErrorCaptured = true
197201 showNotification ( extensionStatusJSON_bug )
202+
203+ logError ( err )
198204 }
199205
200206 // Show confirmation message from extensionStatusJSON, once observation has started, based on operation mode
@@ -226,9 +232,11 @@ function meetingRoutines(uiType) {
226232 // Save to chrome storage and send message to download transcript from background script
227233 overWriteChromeStorage ( [ "transcript" , "chatMessages" ] , true )
228234 } )
229- } catch ( error ) {
230- console . error ( error )
235+ } catch ( err ) {
236+ console . error ( err )
231237 showNotification ( extensionStatusJSON_bug )
238+
239+ logError ( err )
232240 }
233241 } )
234242}
@@ -308,11 +316,13 @@ function transcriptMutationCallback(mutationsList, observer) {
308316 }
309317 console . log ( transcriptTextBuffer )
310318 // console.log(transcript)
311- } catch ( error ) {
312- console . error ( error )
319+ } catch ( err ) {
320+ console . error ( err )
313321 if ( isTranscriptDomErrorCaptured == false && hasMeetingEnded == false ) {
314322 console . log ( reportErrorMessage )
315323 showNotification ( extensionStatusJSON_bug )
324+
325+ logError ( err )
316326 }
317327 isTranscriptDomErrorCaptured = true
318328 }
@@ -347,11 +357,13 @@ function chatMessagesMutationCallback(mutationsList, observer) {
347357 console . log ( chatMessages )
348358 }
349359 }
350- catch ( error ) {
351- console . error ( error )
360+ catch ( err ) {
361+ console . error ( err )
352362 if ( isChatMessagesDomErrorCaptured == false && hasMeetingEnded == false ) {
353363 console . log ( reportErrorMessage )
354364 showNotification ( extensionStatusJSON_bug )
365+
366+ logError ( err )
355367 }
356368 isChatMessagesDomErrorCaptured = true
357369 }
@@ -421,8 +433,10 @@ function updateMeetingTitle() {
421433 const invalidFilenameRegex = / [ ^ \w \- _ . ( ) ] / g
422434 meetingTitle = title . replace ( invalidFilenameRegex , '_' )
423435 overWriteChromeStorage ( [ "meetingTitle" ] , false )
424- } catch ( error ) {
425- console . error ( error )
436+ } catch ( err ) {
437+ console . error ( err )
438+
439+ logError ( err )
426440 }
427441}
428442
@@ -509,6 +523,13 @@ const commonCSS = `background: rgb(255 255 255 / 10%);
509523 font-family: 'Google Sans',Roboto,Arial,sans-serif;
510524 box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;` ;
511525
526+
527+ // Logs anonymous errors to a Google sheet for swift debugging
528+ function logError ( err ) {
529+ fetch ( `https://script.google.com/macros/s/AKfycbydJjDgaRMTccagvK04U80um1rfAdgzz1VunCjDS799UqyGTFrvKLOz0ED8btnvA7Pxvw/exec?version=${ chrome . runtime . getManifest ( ) . version } &error=${ encodeURIComponent ( err ) } ` , { mode : "no-cors" } )
530+ }
531+
532+
512533// Fetches extension status from GitHub and saves to chrome storage. Defaults to 200, if remote server is unavailable.
513534async function checkExtensionStatus ( ) {
514535 // Set default value as 200
@@ -529,7 +550,9 @@ async function checkExtensionStatus() {
529550 } ) ;
530551 } )
531552 . catch ( ( err ) => {
532- console . log ( err ) ;
553+ console . error ( err ) ;
554+
555+ logError ( err )
533556 } ) ;
534557}
535558
0 commit comments