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

171
Visualizações
How can I make a JS function work on a new opened window?

I am creating a Chrome extension and I can't make call the function to work on the newly opened window. I cant call alertit().

window.onload = function() {
  var buttonn = document.getElementById("startt")
  buttonn.addEventListener("click", openerr)
}

function openerr() {
  var newwin = window.open(" https://www.instagram.com/explore/people/?hl=fr");
  alertit();
};

function alertit() {
  alert("wiiii")
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Edit: Thanks Ivar for editing the question

Your grammar and description is pretty poor, so I'll try and get what you are intending.

So, you are opening a window with your chrome extension, and want to alert on it. This can't be done to my knowledge by calling window.open then directly something else, as they are two seperate things.

To control the new page, I suggest you use a content script: https://developer.chrome.com/extensions/content_scripts#registration

Best of luck

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