3

I am trying to create a shortcut for XLaunchpad and WinLaunch so that I can get a "new tab" (which contains the shortcuts to apps, etc.) to appear. Not about:blank or a URL.

However when I use

chrome chrome://newtab

It keeps on opening a new window.

It is sort of the inverse of How can you configure Chrome to open new browser instances in new windows rather than in a tab?

  • Thanks for the comments below. I've edited your question to make it clearer for others to respond to. Please look at the changes to make sure I got it correct. – Isxek Aug 15 '12 at 5:31
3

http://

Just a blank http:// opens a new tab in chrome. This is the StackExchange syntax but its not displaying as a hyperlink:

[http://](http://)

  • Or, in relation to the actual question, use chrome http://somewebsite.com instead of the chrome:// prefix. – Isxek Aug 14 '12 at 10:32
  • 1
    This still opens up the "new tab" in a new window. So this is not correct. – Archimedes Trajano Aug 14 '12 at 15:15
  • @lsxek I am trying to get the "new tab" (which has the apps etc) showing up. – Archimedes Trajano Aug 14 '12 at 15:16
  • actually a blank http:// on the omnibar also redirects to a google search for "http://" so this answer is just wrong. – Archimedes Trajano Aug 14 '12 at 15:18
  • There's a related question on the Chrome forums, but it hasn't been answered yet. Looking at the available CL switches for Chrome, it looks like this ability is not available yet. – Isxek Aug 15 '12 at 7:01
1

I finally found a workable solution thanks to this post:

chrome https://www.google.com/_/chrome/newtab

or

start chrome https://www.google.com/_/chrome/newtab

(Don't ask me why/how this opens chrome://newtab)


The address bar would not auto-focus for me with this method like it did when opening the new tab in a new window, so I came up with a workaround. I put the command to open the new tab page into a batch file, and added a command to send Ctrl+L (the shortcut to focus the address bar) using SendKeys (taken from this answer).

This is my newtab.bat file, which I run using my shortcut button:

@if (@CodeSection == @Batch) @then
@echo off

SET SendKeys=CScript //nologo //E:JScript "%~F0"
SET KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
FOR /F "tokens=2* delims=    " %%A IN ('REG QUERY %KEY_NAME% /ve') DO SET Chrome=%%B

"%Chrome%" "https://www.google.com/_/chrome/newtab"
%SendKeys% "^l"

goto :EOF
@end

// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

It performs these steps:

  1. Get the Chrome executable path from the registry
  2. Run Chrome, opening the newtab page in the existing window
  3. Send Ctrl+L to focus the address bar

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.