feat: rerender only on dom content loaded

This commit is contained in:
Karishma Shukla
2025-06-30 15:16:10 +05:30
committed by GitHub
parent d44892de94
commit 830bf15c9d

View File

@@ -769,18 +769,19 @@ export class RemoteBrowser {
await this.makeAndEmitDOMSnapshot();
});
this.currentPage.on("response", async (response) => {
const url = response.url();
if (
response.request().resourceType() === "document" ||
url.includes("api/") ||
url.includes("ajax")
) {
setTimeout(async () => {
await this.makeAndEmitDOMSnapshot();
}, 800);
}
});
// DO NOT REMOVE THIS CODE - MIGHT BE NEEDED LATER
// this.currentPage.on("response", async (response) => {
// const url = response.url();
// if (
// response.request().resourceType() === "document" ||
// url.includes("api/") ||
// url.includes("ajax")
// ) {
// setTimeout(async () => {
// await this.makeAndEmitDOMSnapshot();
// }, 800);
// }
// });
}
private async setupPageEventListeners(page: Page) {