Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

873
Visualizações
Open a chrome newtab with url chrome://newtab/

The first line works fine, but the second one doesn't work; why?

// Works
window.open('https://google.com/', '_blank'); 

// Doesn't work, why?
window.open('chrome://newtab/', '_blank'); 
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Due to security issues, sadly, you cannot do this in chrome. The best you can do would be to point to google.com if you want the user to have a search bar or something like that. For example, something like this would work:

<a href="https://google.com" target="_blank">Search Anything</a>
about 4 years ago · Juan Pablo Isaza Relatório

0

Unfortunately, utilizing accessible browser APIs, you won't be able to perform what you desire. window.open has the following syntax: window.open(URL, name, specs, replace). The first two specify how this new "window" will be opened. The address of the window's destination. These can be left blank, but it will open a window titled about:blank. The name specifies how the window should be opened, is the second portion (tab, window, etc.).

This URL can't load local resources; therefore, "chrome:/newtab" won't function. If you try to use a period in your URL, it will open a new window with the last website you visited. If you try to start a new window with a slash in the URL, it will open with the base path of the new window. I tested invalid URLs (random strings and characters), and they merely opened a new window with your current URL and appended anything you wrote.

Sources for Reference

https://developer.mozilla.org/en-US/docs/Web/API/Window/open

about 4 years ago · Juan Pablo Isaza Relatório

0

You can just try this out:

const newtab = () =>‌ window.open('dummy url', '_blank');

I think that would work for you ;)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda