Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lambda event: self.emit(Page.Events.RequestFinished, event))
lambda event: self.emit(Page.Events.Response, event))
_nm.on(NetworkManager.Events.RequestFailed,
def closed(fut: asyncio.futures.Future) -> None:
self.emit(Page.Events.Close)
self._closed = True
def _emitMetrics(self, event: Dict) -> None:
self.emit(Page.Events.Metrics, {
'title': event['title'],
'metrics': self._buildMetricsObject(event['metrics']),
})
lambda event: self.emit(Page.Events.FrameAttached, event))
_fm.on(FrameManager.Events.FrameDetached,
lambda event: self.emit(Page.Events.FrameDetached, event))
_fm.on(FrameManager.Events.FrameNavigated,
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)
lambda event: self.emit(Page.Events.Load))
client.on('Runtime.consoleAPICalled',
lambda event: self.emit(Page.Events.RequestFailed, event))
_nm.on(NetworkManager.Events.RequestFinished,