Home > Mobile >  How to change the default browser opened for localhost?
How to change the default browser opened for localhost?

Time:10-10

I have been working with React.js for a couple months now, developing using VS Code, Chromium-based browsers (ditched Chrome, switched to Brave as default browser) and a Windows machine (Windows 10).

Recently, my friend have recommended that I switch to using Firefox for development, and as lazy as developers can go, I wanna ask how to configure such that when I do npm start, localhost:3000 will appear in Firefox instead of my original default browser. I do not want to change my default browser.

Update

From recommendations I have found this other post:
create-react-app: How do I "npm start" with a specific browser?

Further comments are still welcome XD

CodePudding user response:

Change default browser from your machine. Follow the steps in the link below to do it in windows 10.

https://support.microsoft.com/en-us/windows/change-your-default-browser-in-windows-10-020c58c6-7d77-797a-b74e-8f07946c5db6

CodePudding user response:

Edit Your package.json like that:

"scripts": {
    "start": "BROWSER=firefox react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

Type npm start and Voila :-P Best Regards ;-)

  • Related