fix(core): update

This commit is contained in:
2020-06-01 20:19:25 +00:00
parent 2e95f1db7f
commit 4ee936035c
10 changed files with 3024 additions and 1022 deletions

View File

@ -61,12 +61,13 @@ export class SmartBrowser {
* @param urlArg
* @param funcArg
*/
public async evaluateOnPage(urlArg: string, funcArg: () => Promise<any>) {
public async evaluateOnPage<T>(urlArg: string, funcArg: () => Promise<T>) {
const page = await this.headlessBrowser.newPage();
await page.goto(urlArg, {
waitUntil: 'networkidle2'
});
const result = await page.evaluate(funcArg);
await page.close();
return result;
}
}