-
Notifications
You must be signed in to change notification settings - Fork 55
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
Allow command line arguments #120
Comments
Actually, cef works on native side which is same level with flutter engine, we can find that the initialize part is not effect by flutter code. But this does not affect our use of command-line parameters to affect the setting of cef. There is a simple way is that you can try to use shell to start your program with some command-line settings, i guess this would be effectived. @Pebkac03 |
Alright, was worried that might be the case. Might it be possible and a good idea to create a YAML file for developers to hardcode it into their app? Or provide docs on how to do so? |
I think there are many ways to achieve the effect you want, and the cef parameter settings can also be added to the implementation of the OnBeforeChildProcessLaunch function in webview_app.cc, cef is implemented in a multi process mode. |
I'll fork and start experimenting. Hopefully it will be possible. Will post a comment here with what I find. |
That's sounds great, welcome to join us and hope to hear good news. |
Command line arguments provide a standardized way for customization of chromium and by extension CEF. Allowing the webview widget or controller to accept these as arguments would in my opinion extend the functionality of this package. It would for example provide a solution to issue #87 by allowing the scrollbar to be hidden using: --enable-features=OverlaySrollbar.
I am fairly proficient in Flutter and Dart but almost clueless regarding C languages and CEF. I have however found the following to help anyone wanting to undertake a PR:
CEF accepts command line arguments through the the CefExecuteProcess function which I found in webview_cef/common/webview_plugin.cc on line 61. It gets the parameter from the variable mainArgs which is defined in the initCEFProcesses function on line 47 (not 51) in the same file. From there on the trail runs cold for me but it seems to me it would be entirely possible to pass a list of arguments from the webview widget or webview controller in dart to that functions args parameter.
the CEF docs regarding command line arguments can be found here and a list of Chromius command line arguments can be found here.
the dart implementation would by my design look like:
The text was updated successfully, but these errors were encountered: