def _onDialog(self, event: Any) -> None:
dialogType = ''
_type = event.get('type')
if _type == 'alert':
dialogType = Dialog.Type.Alert
elif (_type == 'confirm'):
dialogType = Dialog.Type.Confirm
elif (_type == 'prompt'):
dialogType = Dialog.Type.Prompt
elif (_type == 'beforeunload'):
dialogType = Dialog.Type.BeforeUnload
dialog = Dialog(self._client, dialogType, event.get('message'),
event.get('defaultPrompt'))
self.emit(Page.Events.Dialog, dialog)
评论列表
文章目录