|
|
@ -20,24 +20,28 @@ class ZombieBrowser extends Browser {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
visit(url) {
|
|
|
|
visit(url) {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
this.browser.visit(url, () => {
|
|
|
|
try {
|
|
|
|
const resource = this.browser.resources.length
|
|
|
|
this.browser.visit(url, () => {
|
|
|
|
? this.browser.resources.filter(_resource => _resource.response).shift() : null;
|
|
|
|
const resource = this.browser.resources.length
|
|
|
|
|
|
|
|
? this.browser.resources.filter(_resource => _resource.response).shift() : null;
|
|
|
|
this.window = this.browser.window;
|
|
|
|
|
|
|
|
this.document = this.browser.document;
|
|
|
|
this.window = this.browser.window;
|
|
|
|
this.headers = this.getHeaders();
|
|
|
|
this.document = this.browser.document;
|
|
|
|
this.statusCode = resource ? resource.response.status : 0;
|
|
|
|
this.headers = this.getHeaders();
|
|
|
|
this.contentType = this.headers['content-type'] ? this.headers['content-type'].shift() : null;
|
|
|
|
this.statusCode = resource ? resource.response.status : 0;
|
|
|
|
this.html = this.getHtml();
|
|
|
|
this.contentType = this.headers['content-type'] ? this.headers['content-type'].shift() : null;
|
|
|
|
this.js = this.getJs();
|
|
|
|
this.html = this.getHtml();
|
|
|
|
this.links = this.getLinks();
|
|
|
|
this.js = this.getJs();
|
|
|
|
this.scripts = this.getScripts();
|
|
|
|
this.links = this.getLinks();
|
|
|
|
this.cookies = this.getCookies();
|
|
|
|
this.scripts = this.getScripts();
|
|
|
|
|
|
|
|
this.cookies = this.getCookies();
|
|
|
|
resolve();
|
|
|
|
|
|
|
|
});
|
|
|
|
resolve();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
reject(error.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|