implement simple tab switch

This commit is contained in:
Shin'ya Ueoka 2017-08-12 12:55:37 +09:00
parent f1d4bb8c37
commit 8e5ceebf61
3 changed files with 46 additions and 6 deletions

View file

@ -1,9 +1,12 @@
window.addEventListener("keypress", (e) => {
browser.runtime.sendMessage({
which: e.which || e.keyCode,
}).then((msg) => {
console.log(`Message from the background script: ${msg.response}`);
key: e.which || e.keyCode,
shift: e.shift,
alt: e.alt,
meta: e.meta,
ctrl: e.ctrl,
}).then(() => {
}, (err) => {
console.log(`Error: ${err}`);
console.log(`Vim Vixen: ${err}`);
});
});