From b9c9aeda0352a18ff8db1d4f9cfd5a32004f1198 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Einar=20L=C3=B6ve?= <post@einarlove.com>
Date: Thu, 17 Nov 2016 20:37:20 +0100
Subject: [PATCH] Fix chrome tab reuse (#1035)

* Correctly checks site url to tab url in reuse check

* Bring chrome to foreground focused after tab reuse
---
 packages/react-dev-utils/openChrome.applescript | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/packages/react-dev-utils/openChrome.applescript b/packages/react-dev-utils/openChrome.applescript
index 4dfec4a265..b36b70f6cf 100644
--- a/packages/react-dev-utils/openChrome.applescript
+++ b/packages/react-dev-utils/openChrome.applescript
@@ -23,7 +23,7 @@ on run argv
       set theTabIndex to 0
       repeat with theTab in every tab of theWindow
         set theTabIndex to theTabIndex + 1
-        if theTab's URL is theURL then
+        if theTab's URL as string contains theURL then
           set found to true
           exit repeat
         end if
@@ -38,6 +38,7 @@ on run argv
       tell theTab to reload
       set index of theWindow to 1
       set theWindow's active tab index to theTabIndex
+      tell theWindow to activate
     else
       tell window 1
         activate