Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
always get current data for tabValue
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Dec 20, 2016
1 parent 795cfc2 commit 73db6f8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/browser/api/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ const createTabValue = function (tab) {

tabs[tabId] = {}
tabs[tabId].webContents = tab
tabs[tabId].tabValue = extensions.tabValue(tab)
sendToBackgroundPages('all', getSessionForTab(tabId), 'chrome-tabs-created', tabs[tabId].tabValue)
sendToBackgroundPages('all', getSessionForTab(tabId), 'chrome-tabs-created', getTabValue(tabId))
return tabId
}

Expand All @@ -126,7 +125,8 @@ var getWebContentsForTab = function (tabId) {
}

var getTabValue = function (tabId) {
return tabs[tabId] && tabs[tabId].tabValue
var tabContents = getWebContentsForTab(tabId)
return tabContents && !tabContents.isDestroyed() && extensions.tabValue(tabContents)
}

var getActiveTab = function (windowId) {
Expand Down Expand Up @@ -270,8 +270,7 @@ const chromeTabsUpdated = function (tabId) {
return
}

var tabContents = getWebContentsForTab(tabId)
let tabValue = tabs[tabId].tabValue = extensions.tabValue(tabContents)
let tabValue = getTabValue(tabId)
let changeInfo = {}

for (var key in tabValue) {
Expand Down

0 comments on commit 73db6f8

Please sign in to comment.