Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Chromium #338

Closed
iriobf opened this issue Sep 9, 2020 · 4 comments
Closed

Problem with Chromium #338

iriobf opened this issue Sep 9, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@iriobf
Copy link

iriobf commented Sep 9, 2020

WhatsApp works with Google Chrome 49 or higher.

image

Chromium r782078

image

Library

  • Browser: Chromium r782078
  • NodeJS version: v12.15.0
  • npm or yarn version: 6.13.7
  • whatsapp-web.js version: 1.8.2
@iriobf iriobf added the bug Something isn't working label Sep 9, 2020
@guicuton
Copy link
Contributor

guicuton commented Sep 9, 2020

This error is a bug from puppeter about canvas qrcode after pairing a number...

I've sent one PR to avoid this error → #334

@iriobf
Copy link
Author

iriobf commented Sep 9, 2020

Look this question -> WhatsApp Web is asking to update Chrome while using Chromium

I believe this issue is related to cookies and temporary data

@iriobf
Copy link
Author

iriobf commented Sep 9, 2020

I took the userDataDir out of the puppeteer and it seems to have solved the problem

@iriobf iriobf closed this as completed Sep 10, 2020
@mbenedettini
Copy link

mbenedettini commented Sep 12, 2020

Just save/restore the session:

import * as fs from "fs";
import * as util from "util";
const readFile = util.promisify(fs.readFile);
const writeFile = util.promisify(fs.writeFile);

const sessionFilePath = "./session.json";

async function initialize() {
  let session: any = undefined;
  try {
    session = JSON.parse(await readFile(sessionFilePath, 'utf-8'));
  } catch (e) {
    logger.info('Couldnt load existing session')
  }

  const client = new Client({
    puppeteer: {
      headless: process.env.HEADLESS !== 'false',
    },
    ...(session ? { session } : {})
  });  
  client.on('authenticated', (session: any) => {
    logger.info(`Authenticated: Saving session to ${sessionFilePath}`);
    writeFile(sessionFilePath, JSON.stringify(session));
  });
  client.initialize();
}
initialize();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants