window.addEventListener('keydown', function(evt){ let port = chrome.extension.connect(); switch ( evt.keyCode ){ case 65: // 'a' port.postMessage({'url':'https://www.google.co.jp'}); break; } });