webpage.onConfirm is now called after an beforeunload event

This allows to respond to a dialog box asking confirmation
to close the window.

Closes #198
Documentation of some webpage callback