mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-19 23:35:54 -04:00
It appears to be possible for the debug port to open without any tabs, so we should handle that.
This commit is contained in:
parent
428d6cb7da
commit
5a6749777b
@ -18,6 +18,8 @@ class Umbra:
|
||||
def get_websocket(self, on_open, url=None):
|
||||
def fetch_debugging_json():
|
||||
return loads(urllib.request.urlopen("http://localhost:%s/json" % self.chrome_debug_port).read().decode('utf-8').replace("\\n",""))
|
||||
while len(fetch_debugging_json()) == 0:
|
||||
time.sleep(0.5)
|
||||
debug_info = fetch_debugging_json()
|
||||
if url: #Polling for the data url we used to initialize the window
|
||||
while not [x for x in debug_info if x['url'] == url]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user