In case this helps anyone else,
Resize the Msgbox on orientation change,
screen.orientation.addEventListener("change", function(e) {
resizeNSBMsgbox();
if (screen.orientation.type.startsWith("portrait")) {
console.log("Portrait mode");
} else if (screen.orientation.type.startsWith("landscape")) {
console.log("Landscape mode");
}
});
function resizeNSBMsgbox() {
const dialog = document.getElementById('NSB_MsgBox');
if (!dialog) return;
const content = dialog.querySelector('.dialog-content');
if (!content) return;
const vh = window.innerHeight;
const headerHeight = dialog.querySelector('.dialog-header')?.offsetHeight || 0;
const buttonBarHeight = dialog.querySelector('.dialog-buttonbar')?.offsetHeight || 0;
const topspace = dialog.offsetTop * 2 ;
const padding = 16;
content.style.maxHeight = vh - topspace - headerHeight - buttonBarHeight + padding +"px";
}