Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
Replacing a tab with a different one using JS

Currently, I have something in place that opens a new tab with some html code, using

    const winUrl = URL.createObjectURL(new Blob([final_file], { type: "text/html;charset=utf8" }));
    const win = window.open(winUrl);

where final_file is some html that I generate. I want to make it so instead of opening a new tab every time, if such a tab is already open, it should replace it. I tried using frame names in window.open, but I was told that they are deprecated and shouldn't be used. What do I do?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should place dedicated window name (target as second argument to .open) to your opened window, so browser would know to replace it instead of opening new window:

    const winUrl = URL.createObjectURL(new Blob([final_file], { type: "text/html;charset=utf8" }));
    const win = window.open(winUrl, 'my-window');

target is not deprecated.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda