mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-02 14:49:23 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7db6d58c5 | ||
|
|
56a2d76f38 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.12.3",
|
"version": "5.12.4",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
@@ -2617,25 +2617,13 @@ async function handleKeybindVote(type: number): Promise<void>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addHotkeyListener(): 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(() => {
|
addCleanupListener(() => {
|
||||||
document.body.removeEventListener("keydown", hotkeyListener);
|
document.body.removeEventListener("keydown", hotkeyListener, true);
|
||||||
document.body.removeEventListener("keyup", hotkeyPropagationListener);
|
document.body.removeEventListener("keyup", hotkeyPropagationListener, true);
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
if (document.readyState === "complete") {
|
|
||||||
onLoad();
|
|
||||||
} else {
|
|
||||||
document.addEventListener("DOMContentLoaded", onLoad);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hotkeyListener(e: KeyboardEvent): void {
|
function hotkeyListener(e: KeyboardEvent): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user