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(); await this.makeAndEmitDOMSnapshot();
}); });
this.currentPage.on("response", async (response) => { // DO NOT REMOVE THIS CODE - MIGHT BE NEEDED LATER
const url = response.url(); // this.currentPage.on("response", async (response) => {
if ( // const url = response.url();
response.request().resourceType() === "document" || // if (
url.includes("api/") || // response.request().resourceType() === "document" ||
url.includes("ajax") // url.includes("api/") ||
) { // url.includes("ajax")
setTimeout(async () => { // ) {
await this.makeAndEmitDOMSnapshot(); // setTimeout(async () => {
}, 800); // await this.makeAndEmitDOMSnapshot();
} // }, 800);
}); // }
// });
} }
private async setupPageEventListeners(page: Page) { private async setupPageEventListeners(page: Page) {