I have a page that's intended to be put in full screen mode by the user.
As you may know, in Chrome and I think most other browsers, you can't go to full screen automatically on load with js, it has to be in response to a user action.
The trick is how to refresh the page without taking it out of full screen.
I tried the js below to refresh the content of the page via ajax instead of reloading or submitting it.
The code works I think, but the page still gets knocked out of full screen mode.
Thoughts?
function loadPage(url)
{
fetch(url)
.then(response => response.text())
.then(data => {
document.documentElement.innerHTML = data;
})
.catch(error => {
console.error('Error:', error);
});
}
loadPage(document.URL);