From acb0b884b222c411347c89ded48ef7fc23f33a4c Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Thu, 26 Feb 2015 13:30:52 -0500 Subject: [PATCH] Changed method that onUpdaed works, in order to resolve issue #5 --- background.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/background.js b/background.js index f7889cc..41f3da8 100644 --- a/background.js +++ b/background.js @@ -109,10 +109,14 @@ chrome.tabs.onCreated.addListener(function(currentTab){ }); -chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,currentTab){ - var tab = findTabById(currentTab.windowId, tabId); - tab.window.tabs[tab.index] = currentTab; - saveWindows(); +chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,resultingTab){ + var tab = findTabById(resultingTab.windowId, tabId); + // tab.window.tabs[tab.index] = resultingTab; //Old method that worked, but was weird on some pages such a gist + chrome.tabs.get(tabId,function(currentTab){ + console.log(currentTab); + tab.window.tabs[tab.index] = currentTab; + saveWindows(); + }); }); chrome.tabs.onMoved.addListener(function(tabId,objects){