Advertisement
Guest User

Untitled

a guest
Feb 9th, 2012
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // background
  2. chrome.tabs.getSelected(null, function(tab) {
  3. chrome.tabs.sendRequest(tab.id, {
  4. method: 'countDown',
  5. seconds: seconds,
  6. id: id
  7. }, function(response) {
  8. console.log(response.farewell);
  9. });
  10. });
  11.  
  12. // popup
  13. chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
  14. console.log('request from background');
  15.  
  16. if(request.method == 'countDown') {
  17. console.log(request.seconds);
  18.  
  19. //countDown(request.id);
  20. }
  21.  
  22. sendResponse({});
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement