mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Added more restricted characters
This commit is contained in:
parent
c013c7ef0f
commit
b614dce91a
1 changed files with 2 additions and 2 deletions
|
@ -318,14 +318,14 @@ function activateKeybindChange(element: HTMLElement) {
|
||||||
*/
|
*/
|
||||||
function keybindKeyPressed(element: HTMLElement, e: KeyboardEvent) {
|
function keybindKeyPressed(element: HTMLElement, e: KeyboardEvent) {
|
||||||
var key = e.key;
|
var key = e.key;
|
||||||
if (["Shift", "Control", "Meta", "Alt"].indexOf(key) !== -1) {
|
if (["Shift", "Control", "Meta", "Alt", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab"].indexOf(key) !== -1) {
|
||||||
document.addEventListener("keydown", (e) => keybindKeyPressed(element, e), {once: true});
|
document.addEventListener("keydown", (e) => keybindKeyPressed(element, e), {once: true});
|
||||||
} else {
|
} else {
|
||||||
let button = element.querySelector(".trigger-button");
|
let button = 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
|
// Don't allow keys which are already listened for by youtube
|
||||||
let restrictedKeys = "1234567890,.jklftcibmJKLFTCIBMN/<> -";
|
let restrictedKeys = "1234567890,.jklftcibmJKLFTCIBMNP/<> -+";
|
||||||
if (restrictedKeys.indexOf(key) !== -1 ) {
|
if (restrictedKeys.indexOf(key) !== -1 ) {
|
||||||
element.querySelector(".option-hidden-section").classList.add("hidden");
|
element.querySelector(".option-hidden-section").classList.add("hidden");
|
||||||
button.classList.remove("disabled");
|
button.classList.remove("disabled");
|
||||||
|
|
Loading…
Reference in a new issue