3

I would like to open the page chrome://newtab (a.k.a. the "New Tab" page) in an existing chromium window using the command-line.

this opens a new window with an empty tab:

chromium-browser chrome://newtab

this opens a new tab with the entered URL:

chromium-browser www.google.com

It seems that the first terminal command doesn't recognize newtab as a URL like it does in the second one. Can the call be modified somehow to open a new tab?

2

Open a New Tab and look at the Developer Tools - Sources tab. URL for New Tab is:

chrome-search://local-ntp/local-ntp.html

This will open a new tab in existing Chromium instance:

chromium chrome-search://local-ntp/local-ntp.html
  • This works better than the originally accepted solution, especially concerning that weird xdotool behavior. – Andreas Hacker Sep 25 at 15:49
7

A couple of options to consider...

1) Find an existing instance of Chromium, activate the window, and send Ctrl+t to open a new tab:

xdotool search --onlyvisible --name 'Chromium' windowactivate --sync key --clearmodifiers --window 0 ctrl+t

2) Open the about:blank page in a new tab:

chromium-browser 'about:blank'

#1 does exactly what you want.
#2 is cheesy.

  • In Gnome 3, when I create a Custom Shortcut (Super+T) to execute above shell command, the "Super" modifier "sticks". Any idea how I could fix this? – Andreas Hacker Sep 29 '17 at 9:31
  • 1
    @AndreasHacker, try removing the --clearmodifiers flag from your command line. Documentation here: semicomplete.com/projects/xdotool/xdotool.xhtml#clearmodifiers If that doesn't work, please post a new question specific to xdotool on Gnome 3. Note that there are known issues with xdotool with Walyland with Gnome 3. – TooManyPets Sep 30 '17 at 11:57
  • to further clarify this: #2 is "cheesy" because it does not focus chromium by default – phil294 Oct 13 '18 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.