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

292
Vistas
Print webpage url using window.print() html

I've been attempting to download a webpage directly using window.print() but it seems to skip the print window part. It does open the desired url, but refuse to load on the pdf print window and immediately closes the print window. Here's my code:

const onPrint = () => {
  const url = "https://www.google.com";
  window.open(url)?.print();
}

<a onClick={() => onPrint()}>Click me to download</a>

I also tried to use iframe but it says "google.com refused to connect", I'm aware that sites like Google, Yahoo, etc. won't allow iframes. I'm thinking of auto start download as it get to the external webpage but I'm not sure what should I do..

P/S: I'm using Reactjs to develop my webapp.

about 4 years ago · Juan Pablo Isaza
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