const canvas = document.getElementById('yourCanvas'); canvas.width = 200; // Use document.documentElement.clientWidth for full page width! canvas.height = 200; // Use document.documentElement.clientHeight for full page height!