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

214
Visualizações
How can i open the new tab with chrome extension?

I made a new tab with manifest v3, but the problem is that when I run the extension it opens a new tab, but when I press +(open new tab) it opens this tab, but I don't want to open a new tab with this url, I want to open the default google tab.

Manifest.json

    {
  "name": "NAME",
  "description": "newName",
  "version": "1.0.1.0",
  "manifest_version": 3,
  "chrome_url_overrides": {
    "newtab": "index.html"
  },
  "background": {
    "service_worker": "./background.js"
  },
  "content_scripts": [
    {
      "js": [
        "script.js"
      ],
      "css": [
        "style.css"
      ]
    }
  ],
  "permissions": [
    "scripting",
    "activeTab",
    "tabs"
]
}

background.js

chrome.runtime.onMessage.addListener((msg, sender, response)=>{
    if (msg.name === "message") {
        //Send response
        response({text: "This isaresponse..."});
    }
});
chrome.tabs.create({url: './index.html', selected: true, active: true});
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Have you tried not passing any url as it's an optional param and will default to the New Tab Page?

See docs fro create method:

The URL to initially navigate the tab to. Fully-qualified URLs must include a scheme (i.e., 'http://www.google.com', not 'www.google.com'). Relative URLs are relative to the current page within the extension. Defaults to the New Tab Page.

about 4 years ago · Juan Pablo Isaza Relatório

0

The "chrome_url_overrides newtab" value in your manifest is overriding the default new tab. Remove that from your manifest. If you want to show a page with instructions once before using the extension use the "chrome.runtime.onInstalled" event listener to open a page on installation. Or you could easily handle this with your own solution as well.

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