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

Commit

Permalink
Fall back to default popup value for extension if tab specific value …
Browse files Browse the repository at this point in the history
…not available

Fixes brave/browser-laptop#10224

Auditors: @jonathansampson
  • Loading branch information
bsclifton authored and bridiver committed Oct 4, 2017
1 parent 567986b commit 189ac95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/browser/api/browser-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const updateBrowserAction = (extensionId, details) => {

const getBrowserAction = (extensionId, details) => {
if (details.tabId) {
// return tab specific values (if there are any)
if (browserActions[extensionId] && browserActions[extensionId][details.tabId]) {
return browserActions[extensionId][details.tabId]
}
}
// return extension-wide details
return browserActions[extensionId] || {}
}

Expand Down Expand Up @@ -62,6 +64,6 @@ module.exports = {
},

getPopup: (extensionId, details) => {
return getBrowserAction(extensionId, details).popup
return getBrowserAction(extensionId, details).popup || getBrowserAction(extensionId, {}).popup
}
}

0 comments on commit 189ac95

Please sign in to comment.