HTML default fullscreen

Hello, was wondering if there is a way to make an HTML default to fullscreen or adjust based on window size. I’ve tried setting up Blueprints to run a fullscreen console command upon begin play, as well as a method that I’ve used with other HTML projects (not made in Unreal) in the past, but neither worked. The method for the latter just completely shrinks it, and when adjusting window size, ends up putting the buttons over the game screen and cutting off said screen.

Here’s the different parts of code; Maybe I’m just putting things in the wrong place somewhere.

position: absolute;
left: 50%;
top: 50%;

width: 100%;
height: 100%;

Then in the JavaScript portion:
function resizeGame()
var gameArea = document.getElementById(‘mainarea’);
var widthToHeight = 4/3;
var newWidth = window.innerWidth;
var newHeight = window.innerHeight;
var newWidthToHeight = newWidth/newHeight;

if(newWidthToHeight > widthToHeight)
//Our window’s width is too wide compared to the desired width.
newWidth = newHeight * widthToHeight; = newHeight + ‘px’; = newWidth + ‘px’;
//Our window’s height is too high compared to our desired height.
newHeight = newWidth/widthToHeight = newHeight + ‘px’; = newWidth + ‘px’;
} = (-newHeight/2) + ‘px’; = (-newWidth/2) + ‘px’;

var gameCanvas = document.getElementById(‘canvas’);
gameCanvas.width = newWidth;
gameCanvas.height = newHeight;

window.addEventListener(‘resize’, resizeGame, false);