2024 solution using lvh css units does the work for me.
main { height: 100lvh; }
Get the height via js.
const windowHeightWithoutToolbar = document.documentElement.querySelector("main").clientHeight();
A bit hacky but it works!