Answer the question
In order to leave comments, you need to log in
How to assign hotkeys in a Chrome extension to follow certain links and execute JS functions?
Hello!
There is a working code:
document.onkeypress=function(e){
if(e.keyCode==49 ){
e.preventDefault();
alert('Переход на целевую страницу при нажатии 1');
window.location.href="http://yandex.ru";
}
};
Answer the question
In order to leave comments, you need to log in
Well, why do you need these keyboard shortcuts? I think chrome specifically does not allow this to be done, tk. they already have the necessary functionality for the browser
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question