N
N
number12017-09-27 12:11:30
Google Chrome
number1, 2017-09-27 12:11:30

How to send data from popup.js to background.js?

What is the easiest way to pass data from popup.js to background.js?
Will this one work?
popup

chrome.runtime.sendMessage({site:sait,time:localStorage[sait]});

bg
chrome.runtime.onMessage.addListener(
 function(request, sender, sendResponse) {
//
  });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question