How to write argument for Chrome/Chromium's '--enable-features=' flag - google-chrome

I am trying to modify Chromium browser's behavior in Chromium OS.
When I execute Chromium browser, I can handover arguments with '--enable-features=' flag.
And I found a argument (#enable-virtual-keyboard) from Available list in chrome://flags.
Then I executed Chromium browser like below.
example instruction # /opt/google/chrome/chrome --incognito --enable-features=enable-virtual-keyboard
And when I check the flags in chrome://version, I could see the arguments.
Command Line: /opt/google/chrome/chrome --blahblah --enable-features=enable-virtual-keyboard
But actually the virtual keyboard is not working.
When I enable the argument (virtual keyboard) from chrome://flags manually. It works well and I could see the Virtual Keyboard.
What is wrong? I would appreciate it if you guys advise me.

--enable-features actually takes the name of a feature, not the name of a flag. The Chromium documentation explains the difference, but to simplify somewhat, a flag is sort of a user-visible interface to a feature or a command-line switch.
Anyway, to do what you want, you need to find out what feature or command-line switch the enable-virtual-keyboard flag toggles. Searching for enable-virtual-keyboard in Chromium Code Search brings us to these lines in about_flags.cc:
{"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName,
flag_descriptions::kVirtualKeyboardDescription, kOsCrOS,
SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)},
That last line tells us what we're looking for: that this flag is actually backed by a command-line switch, not a feature. Clicking on kEnableVirtualKeyboard shows us its definition:
const char kEnableVirtualKeyboard[] = "enable-virtual-keyboard";
So, adding --enable-virtual-keyboard to your command line should have the same effect as flipping the flag. (I should note, though, that there are a number of things that can break the virtual keyboard, so you may have to do other things to get it working.)
For the sake of completeness, if you'd found that it was actually backed by a feature, like the gesture-properties-dbus-service flag, for example:
{"gesture-properties-dbus-service",
flag_descriptions::kEnableGesturePropertiesDBusServiceName,
flag_descriptions::kEnableGesturePropertiesDBusServiceDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kGesturePropertiesDBusService)},
Then clicking kGesturePropertiesDBusService takes us to its definition which specifies the feature name:
const base::Feature kGesturePropertiesDBusService{
"GesturePropertiesDBusService", base::FEATURE_DISABLED_BY_DEFAULT};
...so in that case you'd pass --enable-features=GesturePropertiesDBusService to enable the flag from your command line.

Related

How to set proerties for Chrome.exe - Need to replace the shortcut argument

I created a shortcut for Chrome.exe and passed the arguments --disable-web-security --user-data-dir="C:/Chrome dev session"
However the arguments works fine when clicking the shortcuts and able to see the security got disabled.
However i want this change to be permanent....no matter how many shortcuts pointing to the chrome, the arguments should get executed automatically
Does argument can be set in any chrome property files ?
Please advise
Thanks
One Solution is touching the registry. However don't want to touch it and looking for a solution without touching registry
Example,
Firefox to run with the parameters "-p username" when I run "firefox.exe"
https://superuser.com/questions/12230/how-to-set-default-parameters-for-an-application
Run regedit and take a look at the key:
`My Computer\HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\command`
Put -p username into the command string at the appropriate place.
Thanks.

Variable completion in Octave GUI Editor

I mean to get completion of variable names, function names, function argument names, and keywords in Octave, similarly as in Eclipse CDT, e.g.
This works in the Command window, but not in the Editor, where only keywords and functions can be completed.
Official documentation indicates <Tab> and <M-?> should work.
If I press <Tab> I get a Tab character inserted.
And I do not know which is the Modifier key. Plus, I have a Spanish keyboard, so the question mark is obtained with <Shift>+', so I am not sure how will it work if I find the correct M key.
How can I enable it for the Editor?
Notes:
Help -> About shows
GNU Octave, version 4.4.1... configured for "x86_64-w64-mingw32"...
Using Octave portable under Win 10.
I found files <octave-dir>\etc\inputrc.default and <octave-dir>\share\octave\4.4.1\m\startup\inputrc
There is a file C:\Users\user1\.config\octave\qt-settings containing
...
[editor]
...
codeCompletion=true
...
codeCompletion_threshold=2
codeCompletion_keywords=true
codeCompletion_octave_builtins=true
codeCompletion_octave_functions=true
codeCompletion_document=false
codeCompletion_case=true
codeCompletion_replace=false
...
tab_indents_line=false
This refers to the speed of readline for Octave under Win. I have speed issues with readline of my Portable Msys2 under Win 10, but this is a different issue.
On the top of the editor widget, select Edit > Preferences.
Select the Editor tab.
Look for Auto Completion.
Select Match words in document.
There are essentially no references that mention completion specifically in the editor.
The only one I found, from 2014, stating that:
There is no editor completion on all known function names, nor on
parameter lists of known functions. There is an open bug report
requesting function name completion in the editor, see
http://savannah.gnu.org/bugs/?41371.
The GUI is an experimental new feature in the 3.8 release, please
consider helping to improve it for 4.0 by joining the maintainers
mailing list or participating on the bug tracker (even submitting
feature request bugs if you want).
So at that time it was not available.

How to enable web security in Chrome after disabling it?

I did the __disable-web-security in Terminal on Mac. Do I need to enable it again? Or does it enable by itself after restart?
If I need to enable it again, how do I do that? I searched everywhere, but didn't find.
Go to chrome://version and look at the Command Line. If the command line argument is still there, you should restart chrome and then launch it normally (without the flag).
A bit more context: "Flag" refers to two slightly different concepts in Chrome:
Any command line argument that starts with a -- (as opposed to an argument that names a URL or a file, for example).
The list of toggles available at chrome://flags.
Any arguments added manually to the command line will only persist until you quit Chrome. On the other hand, the toggles set at chrome://flags will persist until they are reset. (To further blur this, invoking chrome://restart will preserve the command line flags.)
This particular flag makes its presence fairly obvious, with a banner:
You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer.
So it should hopefully be clear whether the flag is present (and also why this is the sort of flag that can't be persisted at chrome://flags).
The flags set in #2 are delimited in Chrome's command line by the --flags-switches-begin…--flags-switches-end section. Arguments outside of that section are coming from somewhere other than chrome://flags (namely, from the command line, except in the case of Chrome OS and Android, which have their own startup procedures).

enable Chrome flags from the command line

I want to enable a flag (enable-token-binding) while launching chrome.
I can do that using chrome://flags page. but for running tests I need to do it from command line.
I tried
chrome --enable-features=token-binding
chrome --enable-token-binding
None of them worked.
go to chrome://version
Find the command line arguments:
Command Line /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --enable-audio-service-sandbox --flag-switches-begin --enable-features=CookiesWithoutSameSiteMustBeSecure,SameSiteByDefaultCookies --flag-switches-end --enable-audio-service-sandbox
Run the above command with all the arguments and your chrome instance would have all the settings preset.
Try --flag-switches-begin --enable-token-binding --flag-switches-end.
The patter is --flag-switches start and ends capping the flags. Then the names of the flags provided as the parameters within with -- prefixed to them.
Token Binding was removed in Chrome release 70
see https://www.chromestatus.com/feature/5097603234529280
mayankSinha's answer works for the flags he mentions. Note the changed naming convention though: "lower case split by -" convention gets changed to CamelCase.
i.e. same-site-by-default-cookies (as shown in chrome://flags) becomes SameSiteByDefaultCookies

Zsh Shell Smart Completion (ala PhpStorm)

While I'm familiar with a few of the options Zsh provides for autocompletions (i.e. the standard Tab menu-complete and the Ctrl+i completion option), but I've been spoiled with the type of search/completion you can get out of PhpStorm.
For example, in a stock Laravel project in PhpStorm you are able bring up the Search Everywhere dialogue (Double Shift), type in wbp, and have the editor complete that to "welcome.blade.php". The closest I can get to that functionality with Zsh would be to type in wb, place the cursor between the two letters (w|b), and use Ctrl+i.
I have searched around and found a few custom completion scripts, but none that have this type of functionality.
So the big questions are:
1. Is it possible to have smart completion functionality in Zsh like it exists in PhpStorm?
2. If so, how does one go about enabling it?
If it's relevant, I'm using OhMyZsh on OS X 10.12.
The following setup works for me (put them in ~/.zshrc):
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unsetopt CASE_GLOB
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 2 numeric
Reference: zprezto