-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag to set chrome-specific arguments on flutter run -d chrome #1080
Comments
There is also a |
@jakemac53 Is there a way to express this in the launch.json, so that I can have a '1 click' debug routine? |
I don't know anything about the launch configs, I would file an issue on the relevant issue tracker for your IDE or for vscode you can try the gitter channel https://gitter.im/dart-code/Dart-Code. |
When trying to develop a Flutter web from Web IDEs like Gitpod, Chrome is usually installed in a Docker instance.
A solution for this is to keep Chrome from using the shared memory, passing this flag to Chrome executable: But as there isn't an easy way to pass these flags to Chrome we usually need to create a shell script or to use web-server, which isn't always a viable solution. The alternative proposed here could help in this situation. |
The proposed workaround with So I'm stuck here. |
Supported since Flutter
|
We need the |
@atrauzzi If you use IntelliJ, you may have a look here: flutter/flutter-intellij#3450 |
@annagrin I think this can be closed, as its available as flutter option (?) |
I'm not completely familiar with this issue, but as far as I can tell the PR that adds
Generally I'd recommend using the Chrome device, because using It is hidden by default unless you're in a remote workspace to avoid some confusion. If you use this in VS Code, we'll still automatically spawn a browser window - but it's done via VS Code's APIs (and not launched by |
yeah |
@elliette @annagrin once again, this issue can be closed as it is fixed in flutter/flutter#104935 |
I currently have to launch chrome with command-line arguments to work around CORS policy stuff.
Mentioned Here:
flutter/flutter#46904 (comment)
Since it's been decided that there won't be any support of additional CORS-specific stuff, a more general solution is to simply allow us to define arguments to send to chrome on launch.
flutter run -d chrome --web-port=8080 --web-hostname=127.0.0.1 --chrome-args="--disable-web-security --user-data-dir='a-temp-location' %*"
This means i don't have to go down the incredibly hacky route of setting CHROME_EXECUTABLE to a batch script which will just add arguments to my original chrome exe.
TBD exactly how to implement the argument passing.
This seems a lot more portable of a solution and would 'just work' in VS code and other IDE's launch.json.
Note exact implementation is up for debate. And there's an implied (OS-dependent) %* when adding the --chrome-args.
Also note that developers will find a use for other reasons, not just disabling web security.
The text was updated successfully, but these errors were encountered: