Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // background
- chrome.tabs.getSelected(null, function(tab) {
- chrome.tabs.sendRequest(tab.id, {
- method: 'countDown',
- seconds: seconds,
- id: id
- }, function(response) {
- console.log(response.farewell);
- });
- });
- // popup
- chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
- console.log('request from background');
- if(request.method == 'countDown') {
- console.log(request.seconds);
- //countDown(request.id);
- }
- sendResponse({});
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement