Viewport height when display:none

1.) How do I get the viewport height when djs-container is display:none?
2.) Is there a general event where I always get the viewport height?

We show the bpmn modeler in a tab and as soon as we change the tab, the modeler tab is getting display:none. When we then save the bpmn svg, the height, width and viewbox are zero.

Setting the display property to none means that the modeler is no longer present in the DOM. You cannot determine the dimensions of elements that are not in the DOM. So you have to find a way to work around that.