나는 크롬 확장 프로그램을 구축하고있는 바로 가기 및 할당 명령 _execute_browser_action
J+ Alt 키 합니다. 내가 _execute_browser_action
다른 명령의 바로 가기를 통해 호출 할트리거 Chrome 확장
chrome.commands.onCommand.addListener(function(command) { /* ... */ });
사용하는 모든 명령을 수신하는 background.js이 시뮬레이션 할, Cmd를 + 시프트 + K
말 제 발표문에서 json은 다음을 선언했습니다 :
이것은 내 background.js입니다. :
chrome.commands.onCommand.addListener(function(command) {
console.log('onCommand event received for message: ', command);
if (command === "asdf") {
alert("asdf");
var keyPress = jQuery.Event("keypress");
keyPress.altKey = true;
keyPress.ctrlKey = false;
keyPress.which = 74;
//how do I trigger this?
}
});
내 popup.html이 열리도록이를 트리거하는 방법을 알고 싶습니다.