r/FlutterDev • • Feb 28 '19

Tooling VS Code extension adds Dart DevTools integration for a Flutter Inspector 🎉

https://dartcode.org/releases/v2-24/
110 Upvotes

25 comments sorted by

View all comments

1

u/Levelx100 May 23 '19

Any way to launch this with chromium instead of google chrome? I works in chromium but right now if I want to open it I have to Launch it from vs-code get a ProcessException in vs code and then copy the command into my terminal (and wrap the URL in "s) where I have google-chrome aliased to chromium.

Is there any way to alias this for vs-code? or to modify the command to use chromium instead of chrome?

I use mainly Firefox, prefer chromium over chrome on my machine and don't really want to have three browsers installed if I can avoid it

1

u/DanTup May 23 '19

You could try setting the CHROME_EXECUTABLE environment variable to the location of the Chromium executable. I don't know if it'll work, but DevTools is doing the spawning of the browser by using the browser_launcher package and it seems to check this first:

https://github.com/dart-lang/browser_launcher/blob/66215f3b0497cd7794b0a9cd4703437630d5dcc5/lib/src/chrome.dart#L12

1

u/Levelx100 May 24 '19

CHROME_EXECUTABLE

I tried adding that environment variable in both my terminals (bash as well as fish). I also tried replacing google-chrome with chromium in any configuration files related to flutter. Neither of these have worked. Any other ideas by chance?

I suppose it might work if I were to rebuild the browser_launcher package with chomium instead of google chrome however I am not aware of if I would be able to do that.

Worst case scenario I download chrome or launch devtools by copying the command into a shell. Or I avoid using devtools all together, I usually only use it to hide the debug banner anyway.

1

u/DanTup May 24 '19

It's possible if you set it in your terminal but VS Code wasn't launched from there, that it won't have got the variable.

Easiest way to test, is confirm it's set in your terminal, then run pub global run webdev daemon (in your project folder) and see if that changes anything.

If not, you get to some debugging ;-) I would try:

If running that works, then something else is up. If it fails with the same error, then in lib/src/chrome.dart put print(_executable) right before the Process.start call and see whether it got the exe you'd expect.