bs-webapi-incubator icon indicating copy to clipboard operation
bs-webapi-incubator copied to clipboard

Implement adding event listeners for beforeunload

Open TomiS opened this issue 4 years ago • 1 comments

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.

TomiS avatar Apr 14 '20 18:04 TomiS

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...

TomiS avatar Sep 22 '20 11:09 TomiS