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

218
Vistas
Canvas element not extending fullpage even when set to scrollHeight?

I'm working on a browser extension (Chrome / Edge) that injects a Canvas onto any given page, and allows me to draw a rectangle.

The Canvas element SHOULD extend the full scrollHeight of any given page, and it ALMOST does. It just seems to stop just before the footer (as in pic)

enter image description here

How can I fix this so that the Canvas is TRULY FULL PAGE?

Relevant CSS (via JavaScript) and JavaScript below

{
    document.width = '100%';
    document.height = '100%';
    document.body.style.padding = 0;
    document.body.style.margin = 0;
    document.body.width = '100%';
    document.body.height = '100%';
    document.body.style.cursor = "crosshair";

    mainCanvas.style.position = 'absolute';
    mainCanvas.style.top = 0;
    mainCanvas.style.left = 0;
    mainCanvas.width = document.body.scrollWidth;
    mainCanvas.height = document.body.scrollHeight;  // This should be fullpage?
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think by adding pixel unit using string literal may help.

{
    mainCanvas.style.width = `${document.body.scrollWidth}px`;
    mainCanvas.style.height = `${document.body.scrollHeight}px`;
}
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