Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.2K
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!