From f5081802eafd2a015c0596bae7654fa8b22b1082 Mon Sep 17 00:00:00 2001 From: Cap <48036034+CapOliveiraBr@users.noreply.github.com> Date: Tue, 7 Apr 2020 04:00:49 -0300 Subject: [PATCH] Debug URL in initializer --- src/controllers/initializer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controllers/initializer.ts b/src/controllers/initializer.ts index ff168179..5d94d627 100644 --- a/src/controllers/initializer.ts +++ b/src/controllers/initializer.ts @@ -1,4 +1,5 @@ import * as ora from 'ora'; +import { readFileSync } from 'fs'; import { Whatsapp } from '../api/whatsapp'; import { CreateConfig } from '../config/create-config'; import { isAuthenticated, isInsideChat, retrieveQR } from './auth'; @@ -38,6 +39,9 @@ export async function create( spinner.start('Injecting api'); waPage = await injectApi(waPage); spinner.succeed('Whatsapp is ready'); + + const debugURL = `http://localhost:${readFileSync('./session/DevToolsActivePort').slice(0, -54)}`; + console.log(`\nDebug ➜ \x1b[34m${debugURL}\x1b[0m`); return new Whatsapp(waPage); }