Screenshot: Bind CTRL+C

This commit is contained in:
Jade Macho 2024-05-15 00:10:38 +02:00
parent d838e2fa1b
commit 6ca77eedde
Signed by: 0x0ade
GPG Key ID: E1960710FE4FBEEF
2 changed files with 8 additions and 2 deletions

View File

@ -27,6 +27,12 @@ export default JadefinIntegrity("Screenshot", import.meta.url, () => new (class
this.copy(); this.copy();
} }
}); });
document.addEventListener("keydown", e => {
if (e.ctrlKey && e.code == "KeyC" && JadefinUtils.video) {
this.copy();
}
});
} }
copy() { copy() {

View File

@ -80,7 +80,7 @@ export default JadefinIntegrity("Transcript", import.meta.url, () => new (class
JadefinUtils.events.addEventListener(JadefinUtils.eventTypes.WORKER_CREATED, e => { JadefinUtils.events.addEventListener(JadefinUtils.eventTypes.WORKER_CREATED, e => {
const detail = e["detail"]; const detail = e["detail"];
// TODO: 10.9 replaces JSSO / libssa-js with JASSUB, revisit once that's stable. // TODO: 10.9 should've replaced JSSO / libssa-js with JASSUB, revisit once that's stable.
if (!detail.args.scriptURL.endsWith("/libraries/subtitles-octopus-worker.js")) { if (!detail.args.scriptURL.endsWith("/libraries/subtitles-octopus-worker.js")) {
return; return;
} }
@ -297,7 +297,7 @@ export default JadefinIntegrity("Transcript", import.meta.url, () => new (class
} }
// The canvas gets added relatively early, therefore hook drawImage. // The canvas gets added relatively early, therefore hook drawImage.
// TODO: 10.9 replaces JSSO / libssa-js with JASSUB, revisit once that's stable. // TODO: 10.9 should've replaced JSSO / libssa-js with JASSUB, revisit once that's stable.
const canvas = JadefinUtils.video.parentNode?.querySelector("canvas"); const canvas = JadefinUtils.video.parentNode?.querySelector("canvas");
const ctx = canvas?.getContext("2d"); const ctx = canvas?.getContext("2d");