From 76e6da18855ef0a3df6865a851b745983b86072a Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Wed, 13 Aug 2014 18:18:32 -0400 Subject: [PATCH] Added code for tab id storage, related to eventually fixing #7 --- js/code.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/code.js b/js/code.js index f471ffe..b15d069 100644 --- a/js/code.js +++ b/js/code.js @@ -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) {