Skip to content

Commit 293abad

Browse files
committed
stop capture if autolock triggers
1 parent 0109cb5 commit 293abad

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/background.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ function setAutolock() {
410410
document.cookie = `passphrase="${getCachedPassphrase()}${getCookieExpiry()}"`;
411411
autolockTimeout = setTimeout(() => {
412412
cachedPassphrase = "";
413+
const id = contentTab.id;
414+
if (id) {
415+
chrome.tabs.sendMessage(id, { action: "stopCapture" });
416+
}
413417
}, Number(localStorage.autolock) * 60000);
414418
}
415419
}

src/content.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ if (!document.getElementById("__ga_grayLayout__")) {
2323
case "pastecode":
2424
pasteCode(message.code);
2525
break;
26+
case "stopCapture":
27+
const captureBox = document.getElementById("__ga_captureBox__");
28+
if (captureBox) {
29+
captureBox.style.display = "none";
30+
}
31+
32+
const grayLayout = document.getElementById("__ga_grayLayout__");
33+
if (grayLayout) {
34+
grayLayout.style.display = "none";
35+
}
36+
break;
2637
default:
2738
// invalid command, ignore it
2839
break;

0 commit comments

Comments
 (0)