diff --git a/lib/mixins/connect.js b/lib/mixins/connect.js index 87c0275..6fcfcc8 100644 --- a/lib/mixins/connect.js +++ b/lib/mixins/connect.js @@ -89,7 +89,7 @@ export async function connect (timeout = APP_CONNECT_TIMEOUT_MS) { this.log.debug(`Timed out waiting for applications to be reported`); } } - return _.cloneDeep(getAppDict(this)); + return this.appDict; } catch (err) { this.log.error(`Error setting connection key: ${err.message}`); await this.disconnect(); diff --git a/lib/remote-debugger.ts b/lib/remote-debugger.ts index eb744b2..c581212 100644 --- a/lib/remote-debugger.ts +++ b/lib/remote-debugger.ts @@ -236,6 +236,13 @@ export class RemoteDebugger extends EventEmitter { return !!this._rpcClient?.isConnected; } + // Only use this getter to read the appDict value. + // Any changes to it don't mutate the original property + // because the getter always returns the copy of it + get appDict(): AppDict { + return _.cloneDeep(this._appDict); + } + set allowNavigationWithoutReload (allow: boolean) { this._allowNavigationWithoutReload = allow; }