mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 12:09:15 +00:00
fix: make pupBrowser and pupPage available sooner (#137)
* move this.pupBrowser variable to line 51 to resolve not being able to close the browser when it is not connected to the internet * move pupPage along with pupBrowser Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
@@ -48,6 +48,9 @@ class Client extends EventEmitter {
|
|||||||
const page = (await browser.pages())[0];
|
const page = (await browser.pages())[0];
|
||||||
page.setUserAgent(UserAgent);
|
page.setUserAgent(UserAgent);
|
||||||
|
|
||||||
|
this.pupBrowser = browser;
|
||||||
|
this.pupPage = page;
|
||||||
|
|
||||||
if (this.options.session) {
|
if (this.options.session) {
|
||||||
await page.evaluateOnNewDocument(
|
await page.evaluateOnNewDocument(
|
||||||
session => {
|
session => {
|
||||||
@@ -303,9 +306,6 @@ class Client extends EventEmitter {
|
|||||||
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
||||||
});
|
});
|
||||||
|
|
||||||
this.pupBrowser = browser;
|
|
||||||
this.pupPage = page;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the client has initialized and is ready to receive messages.
|
* Emitted when the client has initialized and is ready to receive messages.
|
||||||
* @event Client#ready
|
* @event Client#ready
|
||||||
|
|||||||
Reference in New Issue
Block a user