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

Commit

Permalink
check for -2 directly because tabs sometimes have no index
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed May 1, 2018
1 parent 03759b9 commit 504da0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2597,8 +2597,10 @@ v8::Local<v8::Value> WebContents::TabValue() {
bool WebContents::IsTab() {
#if BUILDFLAG(ENABLE_EXTENSIONS)
auto tab_helper = extensions::TabHelper::FromWebContents(web_contents());
if (tab_helper)
return tab_helper->get_index() > TabStripModel::kNoTab;
if (tab_helper) {
// browserAction haack
return tab_helper->get_index() != -2;
}
#endif

return false;
Expand Down

0 comments on commit 504da0e

Please sign in to comment.