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:
parent
7acbd3d800
commit
1780436b93
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue