There are command line flags (or “switches”) that Chromium (and Chrome) accept in order to enable particular features or modify otherwise default functionality.
Current switches may be found at http://peter.sh/examples/?/chromium-switches.html
It is important to note that using these switches is not supported or recommended. They should only be used for temporary cases and may break in the future.
To use a command line switch:
--disable-gpu-vsync
chrome.exe
--disable-gpu-vsync/Applications/Chromium.app/Contents/MacOS/Chromium --remote-debugging-port=9222 # for Google Chrome you'll need to escape spaces like so: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
chromium-browser --remote-debugging-port=9222
V8 can take a number of flags as well, via Chrome's js-flags
flag. For example, this traces V8 optimizations:
chrome.exe --js-flags="--trace-opt --trace-deopt --trace-bailout"
To get a listing of all possible V8 flags:
chrome.exe --js-flags="--help"
Browse the V8 wiki for more flags for V8.
Visit ‘about:version
’ to review the flags that are effective in the app.
Setting flags for Chrome on Android requires a rooted device, as it necessitates write access to /data/local
You can change these like so:
# For content shell adb shell 'echo "chrome <flags>" > /data/local/tmp/content-shell-command-line' # For chromium test shell adb shell 'echo "chrome <flags>" > /data/local/tmp/android-webview-command-line' # On a chromium checkout, the following utilities can be used: # For chrome public, or Google Chrome adb_chrome_public_command_line <flags> # For content shell: adb_content_shell_command_line <flags> # For chromium test shell: adb_android_webview_command_line <flags> # Or, you can launch content shell with flags directly abd_run_content_shell <flags> adb_run_android_webview <flags>
Remember to quit the app completely and restart for flags to take effect.
There‘s an alternative method for setting flags with ContentShell that doesn’t require a rooted device:
Download a LKGR build of Android.
This will include both ChromePublic.apk and ContentShell.apk
Install ContentShell APK to your device.
Run this magic incantation
adb shell am start
-a android.intent.action.VIEW
-n org.chromium.content_shell_apk/.ContentShellActivity
--es activeUrl “http://chromium.org”
--esa commandLineArgs --show-paint-rects,--show-property-changed-rects
This will launch contentshell with the supplied flags. You can apply whatever commandLineArgs you want in that syntax.
sudo restart ui