message passing between background and content

This commit is contained in:
Shin'ya Ueoka 2017-08-12 11:08:43 +09:00
parent d169661e03
commit e73d405c56
6 changed files with 19 additions and 23 deletions

4
src/background/index.js Normal file
View file

@ -0,0 +1,4 @@
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
console.log("Pressed " + request.which);
sendResponse({ response: "Response from background script" });
});