Max MacLeod
Max MacLeod

Reputation: 26652

How To Start Expo Web In A Specific Browser?

On my Mac, I have Chrome, Firefox, and Safari installed. Safari is set as the default system browser.

Launching expo web using;

expo start -w

works. However, it launches the URI in Chrome rather than Safari. If I delete the Chrome browser, expo will launch in Safari. However I would like to continue with multiple browsers installed.

How can this be overridden so I can choose Safari?

Upvotes: 3

Views: 3297

Answers (3)

andy
andy

Reputation: 1

I found this work well:

expo start

then, shift+d

this will toggle on and off webpage launch

this hit shows right after expo start command

Upvotes: -2

For Windows...

I created project with expo init and for developing i just run this batch:

set BROWSER=chrome
yarn web

It works if there is this setting present in package.json

{
  "scripts": {
    "web": "expo start --web",
  }
}

OR you can simly make the batch file look like this

set BROWSER=chrome
expo start -w

Upvotes: 1

Max MacLeod
Max MacLeod

Reputation: 26652

This issue provides the answer:

https://github.com/expo/expo-cli/issues/1004

As a workaround, you can force a different browser using the BROWSER environment variable.

For me, env BROWSER=firefox expo start works.

For different browsers, use one of the following:

Safari

env BROWSER=safari expo start -w

Firefox

env BROWSER=firefox expo start -w

Chrome

env BROWSER=Google\ Chrome expo start -w

Brave

env BROWSER=Brave\ Browser expo start -w 

Upvotes: 7

Related Questions