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

93
Views
Alternative to window.open that doesn't involve CORS

I have a page with a list of links that were set to open in new windows/tabs with target='_blank' and I wanted to give users a choice to load links in the same window so I've set up a checkbox to toggle the 'newwin' boolean and now open links with the following function

function dolink(myurl) {
if (newwin) { window.open(myurl, '_blank').focus(); }
else { window.open(myurl, '_self'); }
}

It works as expected but sets off all sorts of CORS stupidity now. In the first case it prints a message to the console that 'Storage access automatically granted for origin “NEWSITE” on “MYSITE”' which is bad enough and in the second case it stops resources loading on the new site due to CORS restrictions. Is there a better way to do this? I don't want to join these sites to mine, just link to them.

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

0

Use a tag instead. Change the target attribute of a according to newwin.

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!