Skip to content

Commit 22efd23

Browse files
authored
Merge pull request #29 from vivek-nexus/v2.3.1
v2.3.1
2 parents 04185f9 + 4778fd4 commit 22efd23

5 files changed

Lines changed: 57 additions & 42 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.3.0)
6+
Extension status: 🟢 OPERATIONAL (v2.3.1)
77

88
<br />
99
<br />

extension/background.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ chrome.tabs.onRemoved.addListener(function (tabid) {
3535

3636
function downloadTranscript() {
3737
chrome.storage.local.get(["userName", "transcript", "chatMessages", "meetingTitle", "meetingStartTimeStamp"], function (result) {
38-
if (result.userName && result.transcript && result.chatMessages) {
38+
if (result.userName && (result.transcript.length > 0 || result.chatMessages.length > 0)) {
3939
// Create file name if values or provided, use default otherwise
4040
const fileName = result.meetingTitle && result.meetingStartTimeStamp ? `TranscripTonic/Transcript-${result.meetingTitle} at ${result.meetingStartTimeStamp}.txt` : `TranscripTonic/Transcript.txt`
4141

4242
// Create an array to store lines of the text file
4343
const lines = []
4444

45-
// Iterate through the transcript array and format each entry
46-
result.transcript.forEach(entry => {
47-
lines.push(`${entry.personName} (${entry.timeStamp})`)
48-
lines.push(entry.personTranscript)
49-
// Add an empty line between entries
45+
if (result.transcript.length > 0) {
46+
// Iterate through the transcript array and format each entry
47+
result.transcript.forEach(entry => {
48+
lines.push(`${entry.personName} (${entry.timeStamp})`)
49+
lines.push(entry.personTranscript)
50+
// Add an empty line between entries
51+
lines.push("")
52+
})
5053
lines.push("")
51-
})
52-
lines.push("")
53-
lines.push("")
54+
lines.push("")
55+
}
5456

5557
if (result.chatMessages.length > 0) {
5658
// Iterate through the chat messages array and format each entry

extension/content.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ overWriteChromeStorage(["userName"], false)
2020
// Transcript array that holds one or more transcript blocks
2121
// Each transcript block (object) has personName, timeStamp and transcriptText key value pairs
2222
let transcript = []
23+
overWriteChromeStorage(["transcript"], false)
2324
// Buffer variables to dump values, which get pushed to transcript array as transcript blocks, at defined conditions
2425
let personNameBuffer = "", transcriptTextBuffer = "", timeStampBuffer = undefined
2526
// Buffer variables for deciding when to push a transcript block
@@ -162,7 +163,7 @@ function meetingRoutines(uiType) {
162163
const transcriptTargetNode = document.querySelector('.a4cQT')
163164
// Attempt to dim down the transcript
164165
try {
165-
transcriptTargetNode.childNodes[1].style.opacity = 0.2
166+
transcriptTargetNode.childNodes[1].setAttribute("style", "opacity:0.2")
166167
} catch (error) {
167168
console.error(error)
168169
}
@@ -183,7 +184,7 @@ function meetingRoutines(uiType) {
183184
chatMessagesButton.click()
184185
// CRITICAL DOM DEPENDENCY. Grab the chat messages element. This element is present, irrespective of chat ON/OFF, once it appears for this first time.
185186
try {
186-
const chatMessagesTargetNode = document.querySelectorAll('div[aria-live="polite"]')[0]
187+
const chatMessagesTargetNode = document.querySelector('div[aria-live="polite"].Ge9Kpc')
187188

188189
// Create chat messages observer instance linked to the callback function. Registered irrespective of operation mode.
189190
chatMessagesObserver = new MutationObserver(chatMessagesRecorder)
@@ -193,7 +194,7 @@ function meetingRoutines(uiType) {
193194
console.error(error)
194195
showNotification(extensionStatusJSON_bug)
195196
}
196-
}, 500)
197+
}, 1000)
197198

198199
// Show confirmation message from extensionStatusJSON, once observation has started, based on operation mode
199200
chrome.storage.sync.get(["operationMode"], function (result) {
@@ -389,7 +390,7 @@ function chatMessagesRecorder(mutationsList, observer) {
389390
mutationsList.forEach(mutation => {
390391
try {
391392
// CRITICAL DOM DEPENDENCY. Get all people in the transcript
392-
const chatMessagesElement = document.querySelectorAll('div[aria-live="polite"]')[0]
393+
const chatMessagesElement = document.querySelector('div[aria-live="polite"].Ge9Kpc')
393394
// Attempt to parse messages only if at least one message exists
394395
if (chatMessagesElement.children.length > 0) {
395396
// CRITICAL DOM DEPENDENCY. Get the last message that was sent/received.
@@ -461,11 +462,9 @@ function overWriteChromeStorage(keys, sendDownloadMessage) {
461462
chrome.storage.local.set(objectToSave, function () {
462463
if (sendDownloadMessage) {
463464
// Download only if any transcript is present, irrespective of chat messages
464-
if (transcript.length > 0) {
465-
chrome.runtime.sendMessage({ type: "download" }, function (response) {
466-
console.log(response);
467-
})
468-
}
465+
chrome.runtime.sendMessage({ type: "download" }, function (response) {
466+
console.log(response);
467+
})
469468
}
470469
})
471470
}

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.3.0",
3+
"version": "2.3.1",
44
"manifest_version": 3,
55
"description": "Simple Google Meet transcripts. Private and open source.",
66
"action": {

extension/popup.html

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap');
99

1010
body {
11-
width: 640px;
11+
width: 520px;
1212
padding: 3rem;
1313
background: #071f29;
1414
color: #2A9ACA;
@@ -19,12 +19,12 @@
1919
background-size: cover;
2020
}
2121

22-
hr {
23-
border-color: #2A9ACA;
22+
h1 {
23+
font-size: 2rem;
2424
}
2525

2626
.get-started {
27-
padding: 0.5rem 1rem;
27+
padding: 1rem;
2828
background-color: rgba(255, 255, 255, 0.1);
2929
backdrop-filter: blur(4px);
3030
border-radius: 8px;
@@ -45,9 +45,22 @@
4545
border-radius: 96px;
4646
}
4747

48+
.radio-item {
49+
display: flex;
50+
gap: 0.5rem;
51+
align-items: start;
52+
margin-bottom: 2rem;
53+
}
54+
55+
.sub-text {
56+
font-size: 1rem;
57+
}
58+
4859
input {
60+
margin-top: 0.5rem;
4961
accent-color: #2A9ACA;
5062
width: 18px;
63+
height: 18px;
5164
}
5265

5366
label {
@@ -69,7 +82,7 @@
6982
<div>
7083
<div style="margin-bottom: 2rem;">
7184
<div style="display: flex; gap: 1rem; align-items: center;">
72-
<img src="./icon.png" width="48px" height="48px" alt="" />
85+
<img src="./icon.png" width="48px" height="48px" alt="Extension icon" />
7386
<div>
7487
<h1 style="margin: 0px;">TranscripTonic</h1>
7588
<p style="margin: 0px;">
@@ -79,30 +92,31 @@ <h1 style="margin: 0px;">TranscripTonic</h1>
7992
</div>
8093
</div>
8194

82-
<hr style="margin-bottom: 2rem;" />
8395

84-
<div style="display: flex; gap: 0.25rem;">
85-
<input type="radio" name="mode" id="auto-mode" />
86-
<label><b>Auto</b> (records transcripts for all meetings)</label>
87-
</div>
88-
<div style="margin-bottom: 2rem; display: flex; gap: 0.25rem;">
89-
<input type="radio" name="mode" id="manual-mode" />
90-
<label><b>Manual</b> (switch on transcript as needed) </label>
91-
</div>
9296
<div class="get-started">
93-
<h2>How to use TranscripTonic?</h2>
94-
<p>In both modes, transcript will be automatically downloaded as a text file at the end of each meeting. <b>Avoid
95-
closing the meeting tab.</b></p>
96-
<ul>
97-
<li><b>Auto mode:</b> Automatically records transcripts for all meetings</li>
98-
<li><b>Manual mode:</b> Switch on TranscripTonic by clicking on captions icon in Google Meet (CC icon)</li>
99-
</ul>
97+
<div class="radio-item">
98+
<input type="radio" name="mode" id="auto-mode" />
99+
<label for="auto-mode"><b>Auto mode</b>
100+
<br /><span class="sub-text">Records transcripts for all
101+
meetings</span>
102+
</label>
103+
</div>
104+
<div class="radio-item">
105+
<input type="radio" name="mode" id="manual-mode" />
106+
<label for="manual-mode"><b>Manual mode</b> <br />
107+
<span class="sub-text">Switch on transcript as needed using the CC icon in
108+
Google Meet</span>
109+
</label>
110+
</div>
111+
<p style="margin-bottom: 0rem;">In both modes, transcript will be downloaded as a text file at the end
112+
of each meeting.</p>
100113
</div>
114+
101115
<div>
102116
<div style="margin-bottom: 2.75rem">
103117
<a href="" id="last-meeting-transcript">Download last meeting transcript</a>
104118
&nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
105-
<a href="https://github.com/vivek-nexus/transcriptonic#readme" target="_blank">Get more help</a>
119+
<a href="https://github.com/vivek-nexus/transcriptonic#readme" target="_blank">Get help</a>
106120
&nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
107121
<a href="https://github.com/vivek-nexus/transcriptonic/issues" target="_blank">Report a bug</a>
108122
</div>

0 commit comments

Comments
 (0)