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

217
Views
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 answers
Answer question

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 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!