19

I just started-off with flutter web and I want to use brave browser to debug my flutter apps not chrome or edge.

When I use flutter devices command, it gives the following result.

No devices detected.

Run "flutter emulators" to list and start any available device emulators.

I'm using brave by using the link provided by web-server and it does not support hot reload.

So, how to configure browsers other than chrome or edge with flutter web for complete functionality.

ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36
  • 1
    this [blog post](https://blog.albertobonacina.com/flutter-and-brave-test-your-web-apps-on-your-favorite-browser?guid=none&deviceId=886ec8ea-ed11-48a3-ac6b-6ea478d46d71) worked for me. Make sure you restart vs code(if you are developing with this) once you set the environment variable – RandomUser Jun 03 '21 at 03:26

3 Answers3

21

I found this:

All you have to do, based on your Linux operating system (for Windows and macOS the process is similar), is to modify your .bashrc file and insert this line:

#Put your Brave installation location here
export CHROME_EXECUTABLE="/opt/brave.com/brave/brave-browser"

For MacOs,

export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36
Shahryar Pirooz
  • 410
  • 3
  • 10
  • 3
    You are right, for people that are still stuck on this, please note that `/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser` is not valid due to backslashes `\\`, so do not forget to remove them. – Mathieu Apr 03 '22 at 17:53
  • How to do this for windows? I did set CHROME_EXECUTABLE="path\brave.exe" but it says that this is not an executable – Lavnish Chaudhary Nov 03 '22 at 13:21
  • For MacOs users, if you are using zsh you need to add the `export` to `.zshrc` (instead of `.bashrc`) – Sandro Maglione May 04 '23 at 16:52
8

You can use flutter run -d web-server to run your app like a server. This means that you can just enter the URL on any browser of your choice to access your Flutter app !

Drawbacks:

  • Hot Restart/Reload from the terminal is not possible. You must refresh the page on your browser instead.

Advantages:

  • You can use any browser for developing flutter apps.
  • You can even use ngrok to forward your port to a HTTPS URL, and access your flutter app from anywhere (your phone, your desktop , someone else's device etc.)

PS: Credits to the Issue #77229 for helping me find this solution. I am aware that this workaround has already been suggested on this thread. I just wanted to put out a simpler answer for the general viewer.

Suraj Kumar
  • 81
  • 1
  • 2
3

I've been diving in the same issue, it's known Brave it's Chromium-based, this will help u https://github.com/flutter/flutter/issues/77229

alonsso
  • 51
  • 1
  • 8
  • 3
    I tried using `flutter run -d web-server` but it didn't not support `hot restart` in my case, I had to refresh the browser to see my changes. – ASAD HAMEED Mar 15 '21 at 06:55