Import Google Meet captions project and extension backups

This commit is contained in:
Arash_M
2026-06-08 13:30:43 +03:30
commit e99d6fb287
61 changed files with 4126 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
class CaptionCapture {
constructor() {
this.isCapturing = false; // Flag to control capturing
this.intervalId = null; // Store interval reference
this.lastCaption = ""; // Store last seen caption
}
// Function to detect and get the caption text
detectCaption() {
return document.querySelector('div[jsname="tgaKEf"]')?.innerText || "";
}
// Function to start capturing captions
startCapturing() {
if (this.isCapturing) {
console.log("Caption capturing is already running.");
return;
}
this.isCapturing = true;
console.log("Caption capturing started.");
this.intervalId = setInterval(() => {
let currentCaption = this.detectCaption();
if (currentCaption && currentCaption !== this.lastCaption) {
console.log(currentCaption);
this.lastCaption = currentCaption; // Update last seen caption
}
}, 1000); // Runs every 1 second
}
// Function to stop capturing captions
stopCapturing() {
if (!this.isCapturing) {
console.log("Caption capturing is not running.");
return;
}
this.isCapturing = false;
clearInterval(this.intervalId);
console.log("Caption capturing stopped.");
}
}
// Usage:
const captionCapture = new CaptionCapture();
// Start capturing:
captionCapture.startCapturing();
// Stop capturing:
captionCapture.stopCapturing();