bs-webapi-incubator
bs-webapi-incubator copied to clipboard
Implement adding event listeners for beforeunload
The intention is to enable using this browser feature: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
There seems to already be a type for Webapi.BeforeUnloadEvent, but not a attach an event listener for it. So this PR adds it.
Ok, now I changed the returnValue to be inside Event (including set and delete). But I started reading the Event docs more carefully and they mention the value should be a boolean. However in BeforeUnloadEvent docs they talk about non-empty strings. So the same field should contain different type of data depending on the event type, right?
Did I mention I love the web platform...