mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-19 23:35:54 -04:00
Send more compact JSON to browser
Use JSON separators without spaces to reduce json size. Its already used elsewhere in Brozzler but not here.
This commit is contained in:
parent
0d605d0a88
commit
d6c707d941
@ -228,7 +228,7 @@ class WebsockReceiverThread(threading.Thread):
|
||||
self.websock.send(
|
||||
json.dumps(dict(
|
||||
id=0, method='Page.handleJavaScriptDialog',
|
||||
params={'accept': accept})))
|
||||
params={'accept': accept})), separators=',:')
|
||||
|
||||
def _handle_message(self, websock, json_message):
|
||||
message = json.loads(json_message)
|
||||
@ -314,7 +314,7 @@ class Browser:
|
||||
def send_to_chrome(self, suppress_logging=False, **kwargs):
|
||||
msg_id = next(self._command_id)
|
||||
kwargs['id'] = msg_id
|
||||
msg = json.dumps(kwargs)
|
||||
msg = json.dumps(kwargs, separators=',:')
|
||||
logging.log(
|
||||
brozzler.TRACE if suppress_logging else logging.DEBUG,
|
||||
'sending message to %s: %s', self.websock, msg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user