Hi, I want to show an exit popup by using onbeforeunload like below.
<script>
window.onbeforeunload = function () {
if (specific case) return "show popup"; // show popup and then close window.
else return ""; // just close window
}
</script>
But the specific case what I want is a global variable(bool) on a C# script (This script is a singleton instance).
How can I get this C# script variable state in the index.html?