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

96
Vistas
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 Respuestas
Responde la pregunta

0

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

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