log Network.requestIntercepted

This commit is contained in:
Barbara Miller 2019-05-14 11:59:59 -07:00
parent ee8ef23f0c
commit 4d508cc55c

View File

@ -241,6 +241,12 @@ class WebsockReceiverThread(threading.Thread):
elif message['method'] == 'Network.requestWillBeSent':
if self.on_request:
self.on_request(message)
elif message['method'] == 'Network.requestIntercepted':
if 'params' in message:
for p in message['params']:
self.logger.info(
'Network.requestIntercepted param %s: %s',
p, message['params'][p])
elif message['method'] == 'Page.interstitialShown':
# AITFIVE-1529: handle http auth
# we should kill the browser when we receive Page.interstitialShown and
@ -351,6 +357,10 @@ class Browser:
self.send_to_chrome(method='Page.enable')
self.send_to_chrome(method='Console.enable')
self.send_to_chrome(method='Runtime.enable')
self.send_to_chrome(
method='Network.setRequestInterception',
params={'patterns': [{'urlPattern': '*'}]})
self.send_to_chrome(method='ServiceWorker.enable')
self.send_to_chrome(method='ServiceWorker.setForceUpdateOnPageLoad')