diff --git a/app.js b/app.js index fd6275849..e441624fe 100644 --- a/app.js +++ b/app.js @@ -7,6 +7,7 @@ try { session: 'sessionName_0001', headless: false, devtools: true, + useChrome: false, }) .then((client) => start(client)) .catch(async (err) => { @@ -53,6 +54,16 @@ async function start(client) { } }); + client.onStateChange((state) => { + console.log("State change: " + client.session); + console.log("State change: " + state); + }) + + client.onStreamChange((stream) => { + console.log("Stream change: " + client.session); + console.log("Stream change: " + stream); + }) + client.onMessageEdit((message) => { console.log('EDIT!'); console.log(message); diff --git a/src/controllers/auth.ts b/src/controllers/auth.ts index 6ee2d3c1d..04dc3d02c 100644 --- a/src/controllers/auth.ts +++ b/src/controllers/auth.ts @@ -13,16 +13,21 @@ export const getInterfaceStatus = async (waPage: puppeteer.Page) => { if (erroHTTP && erroHTTP[0].innerText.includes('HTTP ERROR 429')) { return { type: erroHTTP[0].innerText }; } - const elLoginWrapper = document.querySelector( + const elLoginWrapper1 = document.querySelector( 'body > div > div > .landing-wrapper' ); const elLoginWrapper2 = document.querySelector( 'body > div > div > div > .landing-wrapper' ); + const elLoginWrapper3 = document.querySelector( + 'body > div > div > div > div > div > .x1lliihq' + ); + const elQRCodeCanvas = document.querySelector('canvas'); if ( - (elLoginWrapper && elQRCodeCanvas) || - (elLoginWrapper2 && elQRCodeCanvas) + (elLoginWrapper1 && elQRCodeCanvas) || + (elLoginWrapper2 && elQRCodeCanvas) || + (elLoginWrapper3 && elQRCodeCanvas) ) { return 'UNPAIRED'; }