mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Remove keybind restriction.
Closes https://github.com/ajayyy/SponsorBlock/issues/379
This commit is contained in:
@@ -466,9 +466,6 @@
|
|||||||
"theKey": {
|
"theKey": {
|
||||||
"message": "The key"
|
"message": "The key"
|
||||||
},
|
},
|
||||||
"keyAlreadyUsedByYouTube": {
|
|
||||||
"message": "is already used by youtube. Please select another key."
|
|
||||||
},
|
|
||||||
"keyAlreadyUsed": {
|
"keyAlreadyUsed": {
|
||||||
"message": "is bound to another action. Please select another key."
|
"message": "is bound to another action. Please select another key."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -362,15 +362,6 @@ function keybindKeyPressed(element: HTMLElement, e: KeyboardEvent) {
|
|||||||
let button: HTMLElement = element.querySelector(".trigger-button");
|
let button: HTMLElement = element.querySelector(".trigger-button");
|
||||||
let option = element.getAttribute("sync-option");
|
let option = element.getAttribute("sync-option");
|
||||||
|
|
||||||
// Don't allow keys which are already listened for by youtube
|
|
||||||
let restrictedKeys = "1234567890,.jklftcibmJKLFTCIBMNP/<> -+";
|
|
||||||
if (restrictedKeys.indexOf(key) !== -1 ) {
|
|
||||||
closeKeybindOption(element, button);
|
|
||||||
|
|
||||||
alert(chrome.i18n.getMessage("theKey") + " " + key + " " + chrome.i18n.getMessage("keyAlreadyUsedByYouTube"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure keybind isn't used by the other listener
|
// Make sure keybind isn't used by the other listener
|
||||||
// TODO: If other keybindings are going to be added, we need a better way to find the other keys used.
|
// TODO: If other keybindings are going to be added, we need a better way to find the other keys used.
|
||||||
let otherKeybind = (option === "startSponsorKeybind") ? Config.config['submitKeybind'] : Config.config['startSponsorKeybind'];
|
let otherKeybind = (option === "startSponsorKeybind") ? Config.config['submitKeybind'] : Config.config['startSponsorKeybind'];
|
||||||
|
|||||||
Reference in New Issue
Block a user