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

1.2K
Vistas
Browser tab title with Angular when using window.open(...)

In the code behind, I open a new browser tab (window) with a PDF as content, from data as blob from the server. It works, a new tab opens with the document, but the title of the tab of the browser is some hex code. Could dynamically I change this browser tab title? "Document" for example?

Here is the code I use (sorry, could not do a StackBlitz sample as the data comes from a server):

const file = new Blob([data], {type:'application/pdf'});

const fileURL = URL.createObjectURL(file);

window.open(fileURL, '_blank');

And here, how my browser tab looks like:

Browser tab

Solution (works in Chrome and Edge):

var w = window.open(fileURL, '_blank');
setTimeout(function(){ w.document.title = 'My title'; }, 500);

Other solution (works in Chrome, FF and Edge):

var w = window.open(fileURL, '_blank');
w.document.write('<html><head><title>My title</title></head><body height="100%" width="100%"><iframe src="' + fileURL+ '" height="100%" width="100%"></iframe></body></html>');
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Have you seen this post how to show window title using window.open()? ?

There're several ways of achieving this suggested by community

over 4 years ago · Santiago Trujillo 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