mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-20 23:56:34 -04:00
Merge branch 'master' of github.com:internetarchive/brozzler
This commit is contained in:
commit
6290692ac4
@ -1,7 +1,7 @@
|
||||
'''
|
||||
brozzler/chrome.py - manages the chrome/chromium browser for brozzler
|
||||
|
||||
Copyright (C) 2014-2016 Internet Archive
|
||||
Copyright (C) 2014-2020 Internet Archive
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -135,7 +135,7 @@ class Chrome:
|
||||
return cookie_db
|
||||
|
||||
def start(self, proxy=None, cookie_db=None, disk_cache_dir=None,
|
||||
disk_cache_size=None):
|
||||
disk_cache_size=None, websocket_timeout=60):
|
||||
'''
|
||||
Starts chrome/chromium process.
|
||||
|
||||
@ -149,6 +149,7 @@ class Chrome:
|
||||
is inside `self._home_tmpdir` (default None).
|
||||
disk_cache_size: Forces the maximum disk space to be used by the disk
|
||||
cache, in bytes. (default None)
|
||||
websocket_timeout: websocket timeout, in seconds
|
||||
Returns:
|
||||
websocket url to chrome window with about:blank loaded
|
||||
'''
|
||||
@ -200,10 +201,9 @@ class Chrome:
|
||||
self._out_reader_thread.start()
|
||||
self.logger.info('chrome running, pid %s' % self.chrome_process.pid)
|
||||
|
||||
return self._websocket_url()
|
||||
return self._websocket_url(timeout_sec=websocket_timeout)
|
||||
|
||||
def _websocket_url(self):
|
||||
timeout_sec = 600
|
||||
def _websocket_url(self, timeout_sec = 60):
|
||||
json_url = 'http://localhost:%s/json' % self.port
|
||||
# make this a member variable so that kill -QUIT reports it
|
||||
self._start = time.time()
|
||||
|
Loading…
x
Reference in New Issue
Block a user