11let transcript = [ ]
2- let personNameBuffer = "" , transcriptTextBuffer = ""
2+ let personNameBuffer = "" , transcriptTextBuffer = "" , timeStampBuffer = undefined
33let beforePersonName = "" , beforeTranscriptText = ""
44const options = {
55 year : 'numeric' ,
@@ -9,7 +9,7 @@ const options = {
99 minute : '2-digit' ,
1010 hour12 : true
1111} ;
12- let meetingStartTimeStamp = new Date ( ) . toLocaleString ( "default" , options ) . replace ( / [ / : ] / g, '-' )
12+ let meetingStartTimeStamp = new Date ( ) . toLocaleString ( "default" , options ) . replace ( / [ / : ] / g, '-' ) . toUpperCase ( )
1313let meetingTitle = document . title
1414const extensionStatusJSON_bug = {
1515 "status" : 400 ,
@@ -28,6 +28,7 @@ checkExtensionStatus().then(() => {
2828 const captionsButton = contains ( ".material-icons-extended" , "closed_caption_off" ) [ 0 ]
2929
3030 console . log ( "Meeting started" )
31+
3132 setTimeout ( ( ) => {
3233 // pick up meeting name after a delay
3334 meetingTitle = updateMeetingTitle ( )
@@ -192,7 +193,7 @@ function transcriber(mutationsList, observer) {
192193 // Callback function to execute when mutations are observed
193194 setTimeout ( ( ) => {
194195 mutationsList . forEach ( mutation => {
195- if ( document . querySelector ( '.a4cQT' ) . firstChild . firstChild . childNodes . length > 0 ) {
196+ if ( document . querySelector ( '.a4cQT' ) ? .firstChild ? .firstChild ? .childNodes . length > 0 ) {
196197 const people = document . querySelector ( '.a4cQT' ) . firstChild . firstChild . childNodes
197198
198199 const person = people [ people . length - 1 ]
@@ -204,26 +205,33 @@ function transcriber(mutationsList, observer) {
204205 const currentPersonName = person . childNodes [ 0 ] ? person . childNodes [ 0 ] . textContent : ""
205206 const currentTranscriptText = person . childNodes [ 1 ] . lastChild ? person . childNodes [ 1 ] . lastChild . textContent : ""
206207
208+ // starting fresh with a person
207209 if ( beforeTranscriptText == "" ) {
208210 personNameBuffer = currentPersonName
211+ timeStampBuffer = new Date ( ) . toLocaleString ( "default" , options ) . toUpperCase ( )
209212 beforeTranscriptText = currentTranscriptText
210213 transcriptTextBuffer += currentTranscriptText
211214 }
212215 else {
216+ // new person started speaking
213217 if ( personNameBuffer != currentPersonName ) {
214218 pushToTranscript ( )
215219 overWriteChromeStorage ( )
216220 beforeTranscriptText = currentTranscriptText
217- personNameBuffer = currentPersonName ;
218- transcriptTextBuffer = currentTranscriptText ;
221+ personNameBuffer = currentPersonName
222+ timeStampBuffer = new Date ( ) . toLocaleString ( "default" , options ) . toUpperCase ( )
223+ transcriptTextBuffer = currentTranscriptText
219224 }
225+ // same person speaking more
220226 else {
227+ // string subtraction
221228 transcriptTextBuffer += currentTranscriptText . substring ( currentTranscriptText . indexOf ( beforeTranscriptText ) + beforeTranscriptText . length )
222229 beforeTranscriptText = currentTranscriptText
223230 }
224231 }
225232 }
226233 else {
234+ // no transcript yet or no one is speaking
227235 console . log ( "No active transcript" )
228236 if ( ( personNameBuffer != "" ) && ( transcriptTextBuffer != "" ) ) {
229237 pushToTranscript ( )
@@ -243,6 +251,7 @@ function transcriber(mutationsList, observer) {
243251function pushToTranscript ( ) {
244252 transcript . push ( {
245253 "personName" : personNameBuffer ,
254+ "timeStamp" : timeStampBuffer ,
246255 "personTranscript" : transcriptTextBuffer
247256 } )
248257}
@@ -289,3 +298,42 @@ async function checkExtensionStatus() {
289298}
290299
291300
301+
302+ // CURRENT GOOGLE MEET TRANSCRIPT DOM
303+
304+ { /* <div class="a4cQT" jsaction="bz0DVc:HWTqGc;TpIHXe:c0270d;v2nhid:YHhXNc;kDAVge:lUFH9b;QBUr8:lUFH9b;stc2ve:oh3Xke"
305+ jscontroller="D1tHje" style="right: 16px; left: 16px; bottom: 80px;">
306+ <div>
307+ <div class="iOzk7" jsname="dsyhDe" style="">
308+ //PERSON 1
309+ <div class="TBMuR bj4p3b" style="">
310+ <div><img alt="" class="KpxDtd r6DyN"
311+ src="https://lh3.googleusercontent.com/a/some-url"
312+ data-iml="453">
313+ <div class="zs7s8d jxFHg">Person 1</div>
314+ </div>
315+ <div jsname="YSxPC" class="Mz6pEf wY1pdd" style="height: 28.4444px;">
316+ <div jsname="tgaKEf" class="iTTPOb VbkSUe">
317+ <span>Some transcript text.</span>
318+ <span>Some more text.</span></div>
319+ </div>
320+ </div>
321+
322+ // PERSON 2
323+ <div class="TBMuR bj4p3b" style="">
324+ <div><img alt="" class="KpxDtd r6DyN"
325+ src="https://lh3.googleusercontent.com/a/some-url"
326+ data-iml="453">
327+ <div class="zs7s8d jxFHg">Person 2</div>
328+ </div>
329+ <div jsname="YSxPC" class="Mz6pEf wY1pdd" style="height: 28.4444px;">
330+ <div jsname="tgaKEf" class="iTTPOb VbkSUe">
331+ <span>Some transcript text.</span>
332+ <span>Some more text.</span></div>
333+ </div>
334+ </div>
335+ </div>
336+ <div class="iOzk7" jsname="APQunf" style="display: none;"></div>
337+ </div>
338+ <More divs />
339+ </div> */ }
0 commit comments