diff --git a/remote/Connection.jsm b/remote/Connection.jsm index b9b4e8791697..37a238221e51 100644 --- a/remote/Connection.jsm +++ b/remote/Connection.jsm @@ -6,11 +6,11 @@ var EXPORTED_SYMBOLS = ["Connection"]; -const { Log } = ChromeUtils.import("chrome://remote/content/Log.jsm"); const { XPCOMUtils } = ChromeUtils.import( "resource://gre/modules/XPCOMUtils.jsm" ); +const { Log } = ChromeUtils.import("chrome://remote/content/Log.jsm"); const { UnknownMethodError } = ChromeUtils.import( "chrome://remote/content/Error.jsm" ); @@ -61,9 +61,10 @@ class Connection { this.sessions.set(session.id, session); } - send(message) { - log.trace(`<-(connection ${this.id}) ${JSON.stringify(message)}`); - this.transport.send(message); + send(body) { + const payload = JSON.stringify(body, null, Log.verbose ? "\t" : null); + log.trace(`<-(connection ${this.id}) ${payload}`); + this.transport.send(JSON.parse(payload)); } /**