Skip to content

Commit 5af975a

Browse files
authored
Merge pull request #7 from vivek-nexus/v2.0.2
v2.0.2
2 parents 074d8c4 + 8706f51 commit 5af975a

4 files changed

Lines changed: 56 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Simple Google Meet transcripts. Private and open source.
33

44
![marquee-large](/assets/marquee-large.png)
55

6-
Extension status: 🟢 OPERATIONAL (v2.0.1)
6+
Extension status: 🟢 OPERATIONAL (v2.0.2)
77

88
<br />
99
<br />

extension/background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function downloadTranscript() {
2929

3030
// Iterate through the transcript array and format each entry
3131
result.transcript.forEach(entry => {
32-
lines.push(entry.personName);
32+
lines.push(`${entry.personName} (${entry.timeStamp})`);
3333
lines.push(entry.personTranscript);
3434
lines.push(''); // Add an empty line between entries
3535
});

extension/content.js

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let transcript = []
2-
let personNameBuffer = "", transcriptTextBuffer = ""
2+
let personNameBuffer = "", transcriptTextBuffer = "", timeStampBuffer = undefined
33
let beforePersonName = "", beforeTranscriptText = ""
44
const 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()
1313
let meetingTitle = document.title
1414
const 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) {
243251
function 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> */}

extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TranscripTonic",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"manifest_version": 3,
55
"description": "Simple Google Meet transcripts. Private and open source.",
66
"action": {

0 commit comments

Comments
 (0)