Skip to content

beforeunload()

Accept or dismiss a beforeunload popup.

beforeunload(async () => await accept())
beforeunload(async () => await dismiss())
// Note: Taiko's `beforeunload` listener can be setup anywhere in the
// script. The listener will run when the popup displays on the page.
NameTypeDescription
callbackfunctionAction to perform. Accept/Dismiss.

This API does not return any values.