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

120
Views
View instead of downloading an image in new chrome tab using JS

I am creating a chrome extension that will open a link to an image in a new tab.

However I am coming across links that will automatically download the image instead of viewing it in the new chrome tab.

I am using the following code to do create the new tab:

chrome.tabs.create({ url: url_to_open, active: false});

Example of "unviewable" image from vsco: "im.vsco.co/aws-us-west-2/de89e8/880500/627c05d3edd24e3c58174876/vsco_051122.jpg?w=749&dpr=1"

Is there any way to not automatically download the image but view it instead?

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can simply create a link element that opens a new tab on click.

let ln = document.createElement('a');
ln.href = 'url here';
ln.setAtrribute('target', '_blank');
ln.click();
about 4 years ago · Juan Pablo Isaza 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!