feat: get html
This commit is contained in:
@@ -174,12 +174,14 @@ export class RemoteBrowser {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes and emits a single screenshot to the client side.
|
* Makes and emits a single screenshot to the client side.
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
public makeAndEmitScreenshot = async (): Promise<void> => {
|
public makeAndEmitScreenshot = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
|
const html = await this.currentPage?.content();
|
||||||
|
await this.currentPage?.setContent(html || '')
|
||||||
const screenshot = await this.currentPage?.screenshot();
|
const screenshot = await this.currentPage?.screenshot();
|
||||||
if (screenshot) {
|
if (screenshot) {
|
||||||
this.emitScreenshot(screenshot.toString('base64'));
|
this.emitScreenshot(screenshot.toString('base64'));
|
||||||
@@ -188,7 +190,7 @@ export class RemoteBrowser {
|
|||||||
const { message } = e as Error;
|
const { message } = e as Error;
|
||||||
logger.log('error', message);
|
logger.log('error', message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the active socket instance.
|
* Updates the active socket instance.
|
||||||
|
|||||||
Reference in New Issue
Block a user