Skip to content

Commit

Permalink
Added code for tab id storage, related to eventually fixing #7
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Aug 13, 2014
1 parent 6163483 commit 76e6da1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,14 @@ var currentTabId = -1;


chrome.tabs.getSelected(null, function(tab){
currentTabId=tab.id;
//console.log(("tab id in getselected "+currentTabId);
//console.log(document.images);
chrome.storage.local.set({'lastTabId':tab.id});


chrome.storage.local.get('lastTabId',function(result){
$("body").append("Tab IDY: "+result.lastTabId);
$("body").append(tab.url);
});

var port = chrome.tabs.connect(tab.id,{name: "getImageData"}); //create a persistent connection
port.postMessage({url: tab.url, method: 'getImageData'});
port.onMessage.addListener(function(msg) {
Expand Down

0 comments on commit 76e6da1

Please sign in to comment.