Conditional check for if the game is being run in a browser?

Hey folks,

The game I'm currently working on is, at the moment, just going to be hosted on itch and played through the Browser embed. However, I'm not sure if I may also want a regular Windows version as well.

The problem is this: I'm using a custom evented main menu/pause menu screen and I've included a button to quit the software, but if it's being played in a browser, that doesn't make much sense, and I just tested it and basically the button would just kind of make the game do... nothing.

So my question is, is there a line of script I could write in a conditional branch to check what platform the game is running on? That way I could disable the exit command when in browser mode.

Thanks for any advice you've got.
RMMV games are HTML-games, they always run in a browser.
even the exe from windows deployment is nothing but a browser that has been stripped of the regular controls and only works with the adress of the game's index.html

if the button does nothing in a browser, then most likely you used the wrong command there because otherwise it would quit even a browser.
JavaScript:
Utils.isNwjs()
Returns true iff the game is running as a standalone app, i.e. NWJS.
JavaScript:
Utils.isNwjs()
Returns true iff the game is running as a standalone app, i.e. NWJS.
Thank you! I've tested things out and that did EXACTLY what I wanted it to do. 🙂
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/conditional-check-for-if-the-game-is-being-run-in-a-browser.154328/