In Game Panel Hide & Minimized Reset

I am working on developing an in-game panel for a checklist that uses data from SimBrief. It’s using an iFrame, and I have two features I can’t quite figure out.

First…I want the panel to hide with a shortcut key. The Navigraph charts does this and it’s a nice touch so the website closes and does not reload but you can hide the panel. I have a keyboard shortcut listener working (using Ctrl+N) for development. When it detects the key, I append ‘panelInvisible’ to the class, but I don’t think this is right. This method works if I have moved the panel, but if I interact with the panel to load the checklist or on the first load before I interact with it, it won’t hide the panel. I am guessing brute force appending ‘panelInvisible’ isn’t the best way to do this, but watching how the Navigraph Charts panel interacts with the HTML, I can see that when their shortcut key is picked up, it appends ‘panelInactive’ ‘panelInvisible’ to the class. Is there a better way to change or add the panelInvisible class in the JS after picking up a shortcut?

Second, is there any way to prevent the iFrame from reloading when the panel is minimized? I understand the reload when it’s closed, but I would prefer to prevent it from refreshing when it’s minimized.


I was able to solve both of these issues. The first one was a focus issue between the sim and the Iframe. When interacting with the Iframe the keylistner in the panel’s JS wouldn’t work so I put a keylistener in the websites JS and pass it to the sim window with an Iframe message. And now it seamlessly goes invisible with the shortcut command.

Second I simply had to save the page state with any interaction since the sim will reload the page quite a bit.

Additionally, is there any way through JS and a to get airport data by ICAO such as rhe runway heading? I can get metar data from the sim fine using that,