flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
163.66k stars 26.92k forks source link

Support Microsoft Edge on Mac and Linux in flutter run #78153

Open thomassth opened 3 years ago

thomassth commented 3 years ago

Continuing #55322

MS edge has stable release on Mac and currently has dev releases on Linux. Please lift the "Windows only" restriction for flutter run -d edge.

In the long term, please allow user to choose and use any chromium-based browser installation for flutter run and not have to request support for every one of them. Add a "at your own risk" disclaimer if you don't want to officially support them, but let the devs choose their environment.

thomassth commented 3 years ago

Any update on the matter?

Quazmoz commented 3 years ago

I would also love to have Edge and/or other chromium browsers as an option while I develop using flutter on Linux

ddzy commented 2 years ago

Any progress?

cpboyd commented 2 years ago

FYI: since it's ultimately Chromium, you can just set $CHROME_EXECUTABLE.

e.g. on Mac: export CHROME_EXECUTABLE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" (for all terminals, you can add that to ~/.zshrc)

This does have the slight disadvantage of not easily switching between the two, but I only use Edge on my Mac due to concerns raised about the Google Update service.

LouisSung commented 2 years ago

What if Edge on macOS crashes immediately when started

TL;DR

Try adding these flags to manually start an Edge instance and see if it crashes, i.e., $ /Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --user-data-dir='' --remote-debugging-port='54321' --disable-background-timer-throttling --disable-extensions --disable-popup-blocking --bwsi --no-first-run --no-default-browser-check --disable-default-apps --disable-translate

About my case

I executed flutter run -d chrome -v using Edge (with export CHROME_EXECUTABLE) and Chrome (without export) respectively. However, even they showed almost the same logs, the edge crashed immediately when opened (about 0.5 seconds) without any error message, and led the SocketException: Connection refused (OS Error: Connection refused, errno = 61), as the Edge instance to connect was crashed.

It took me about an hour to find the solution, trace code, and even give up and then installed the Chrome... However, I suddenly realized, what if the crashes were not caused by Flutter, but Edge itself? Therefore, I decided to figure out what exact the command the -d chrome executed to start a Chrome instance?

In my case, running Edge with /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge --remote-debugging-port='54321', without anything about Flutter, also crashed. Although the other Edge instances worked normally without hanging or issues, I still tried to force quit and restart the Edge, and then everything went well now...

For ones who suffered from the crashes, try to run an Edge instace with flags before blaming Flutter

ps. I was using macOS 12.2.1, Edge 98.0.1108.56, and Flutter 2.10.3

Edge crashed (and fixed after force restart): image Chrome worked well: image

chasanpro commented 2 years ago

I am wondering still no support for edge even it is miles ahead of chrome

LouisSung commented 2 years ago

I am wondering still no support for edge even it is miles ahead of chrome

What do you mean no support? I think the export CHROME_EXECUTABLE='/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge' works as is? 🤔

Is there any problem using such an approach?

chasanpro commented 2 years ago

image Can anyone have any idea regarding this script So that we can launch FLutter web app in msedge

chasanpro commented 2 years ago

I am wondering still no support for edge even it is miles ahead of chrome

What do you mean no support? I think the export CHROME_EXECUTABLE='/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge' works as is? 🤔

Is there any problem using such an approach?

It haven't worked for me even chrome disappeared after running Flutter Devices command

LouisSung commented 2 years ago

Have you ever tried the hello world (counter) app and also got an error? Any info like Flutter, masOS, Edge, and Chrome versions? any error logs or screenshots?

-- You should at least state out what works and what doesn't, and the difference configs between them Always provide a minimal reproducible example, such as the hello world app, newly set up Mac/Edge environment, or cross validation using Edge and Chrome, to narrow down the direction and to provide enough information for others to help

You may have found out the problems during the troubleshooting your own, and share with others afterwards if you'd like

ZhuChanJuan commented 2 months ago

oh, i encountered the same issue i use the counter app (which is quite sample UI), newly set up Mac Edge/Chrome/Firefox environment and Android emulators with Edge/Chrome/Firefox environment. after trying with all methods i could found on the website such as : https://github.com/flutter/flutter/wiki/Running-Flutter-Driver-tests-with-Web

https://chromium.googlesource.com/external/github.com/flutter/engine/+/refs/heads/flutter-1.24-candidate.7/e2etests/web/regular_integration_tests#using-different-browsers I still couldn't open flutter test case on web browser except MacOS chrome, means the MacOS edge/firefox/safari browsers and Android emulators chrome/edge/firefox browsers all can't be triggered by flutter related commands. So i'm wondering flutter native testing framework can only support MacOS chrome at all.

neoacevedo commented 2 months ago

What if Chrome or Edge are installed via flatpak?