mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-16 08:27:03 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7db6d58c5 | ||
|
|
56a2d76f38 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_fullName__",
|
||||
"short_name": "SponsorBlock",
|
||||
"version": "5.12.3",
|
||||
"version": "5.12.4",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_Description__",
|
||||
"homepage_url": "https://sponsor.ajay.app",
|
||||
|
||||
@@ -2617,25 +2617,13 @@ async function handleKeybindVote(type: number): Promise<void>{
|
||||
}
|
||||
|
||||
function addHotkeyListener(): void {
|
||||
document.addEventListener("keydown", hotkeyListener);
|
||||
document.addEventListener("keydown", hotkeyListener, true);
|
||||
document.addEventListener("keyup", hotkeyPropagationListener, true);
|
||||
|
||||
const onLoad = () => {
|
||||
// Allow us to stop propagation to YouTube by being deeper
|
||||
document.removeEventListener("keydown", hotkeyListener);
|
||||
document.body.addEventListener("keydown", hotkeyListener);
|
||||
document.body.addEventListener("keyup", hotkeyPropagationListener);
|
||||
|
||||
addCleanupListener(() => {
|
||||
document.body.removeEventListener("keydown", hotkeyListener);
|
||||
document.body.removeEventListener("keyup", hotkeyPropagationListener);
|
||||
});
|
||||
};
|
||||
|
||||
if (document.readyState === "complete") {
|
||||
onLoad();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", onLoad);
|
||||
}
|
||||
addCleanupListener(() => {
|
||||
document.body.removeEventListener("keydown", hotkeyListener, true);
|
||||
document.body.removeEventListener("keyup", hotkeyPropagationListener, true);
|
||||
});
|
||||
}
|
||||
|
||||
function hotkeyListener(e: KeyboardEvent): void {
|
||||
|
||||
Reference in New Issue
Block a user