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

247
Visualizações
how to solve windows.close don't work with street view

I'm trying to open a street view floating window with "window.open" and then close with "close()". I try with google.com, and it works (the window close). But, with the street view window, doesn't work (don't close). If I open and close immediately it works. I think it's because of redirection. ¿Any ideas to solve?

I have tried it on https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default_default

<!DOCTYPE html>
<html>
<body>

<h1>Google</h1>

<button onclick="openGoogle()">Open "google"</button>
<button onclick="closeGoogle()">Close "google"</button>
<br>
<h1>StreetView</h1>
<button onclick="openStreetView()">Open "streetview"</button>
<button onclick="closeStreetView()">Close "streetview"</button>

<script>
let google;
let streetview;

function openGoogle() {
  google = window.open("https://www.google.com/", "Google", "width=800,height=800");
}

function closeGoogle() {
  google.close();
}


function openStreetView() {
  streetview = window.open("https://www.google.com/maps/@43.3396007,-1.8096601,3a,75y,90t/data=!3m6!1e1!3m4!1sZ81gym2y_KL-MPWdBQ1Mqg!2e0!7i16384!8i8192", "Google", "width=800,height=800");
}

function closeStreetView() {
  streetview.close();
}

</script>

</body>
</html>
about 4 years ago · Santiago Trujillo
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