Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open chrome:// URL's from the command line?

You can open a URL in chrome from the command line with:

google-chrome https://example.com

Is there a way to open chrome:// URL's (such as chrome://bookmarks/) in this manner? When I try to open a chrome:// URL from the shell, chrome simply opens an empty browser tab.

It wouldn't be surprising if Chrome simply refuses to as a matter of user protection. If that happens to be the case: where is this documented?

like image 697
ebpa Avatar asked Dec 09 '18 16:12

ebpa


1 Answers

Solution for X Window systems, using xdotool:

Put this in a shell script:

# Usage example: $0 chrome://settings/ #even works for https:// links
chromium& #opens new tab. (Maybe your browser is called chrome.)
sleep 2
xdotool type $@$'\n'
like image 75
Dan Jacobson 積丹尼 Avatar answered Sep 17 '22 11:09

Dan Jacobson 積丹尼