feat: make and emit ss to client
This commit is contained in:
@@ -174,4 +174,21 @@ export class RemoteBrowser {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes and emits a single screenshot to the client side.
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
public makeAndEmitScreenshot = async() : Promise<void> => {
|
||||||
|
try {
|
||||||
|
const screenshot = await this.currentPage?.screenshot();
|
||||||
|
if (screenshot) {
|
||||||
|
this.emitScreenshot(screenshot.toString('base64'));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
const { message } = e as Error;
|
||||||
|
logger.log('error', message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user