From 504da0ed8decd43d0db56365fac96f79ece40fb8 Mon Sep 17 00:00:00 2001
From: bridiver <github@brianjohnson.cc>
Date: Mon, 30 Apr 2018 20:55:25 -0700
Subject: [PATCH] check for -2 directly because tabs sometimes have no index

---
 atom/browser/api/atom_api_web_contents.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc
index dc01aaee2f..baab2553a6 100644
--- a/atom/browser/api/atom_api_web_contents.cc
+++ b/atom/browser/api/atom_api_web_contents.cc
@@ -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;