chore: lint
This commit is contained in:
@@ -104,7 +104,7 @@ export class RemoteBrowser {
|
|||||||
} catch {
|
} catch {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a URL change is significant enough to emit
|
* Determines if a URL change is significant enough to emit
|
||||||
@@ -130,11 +130,11 @@ export class RemoteBrowser {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Handle page load events with retry mechanism
|
// Handle page load events with retry mechanism
|
||||||
page.on('load', async () => {
|
page.on('load', async () => {
|
||||||
const injectScript = async (): Promise<boolean> => {
|
const injectScript = async (): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
await page.waitForLoadState('networkidle', { timeout: 5000 });
|
await page.waitForLoadState('networkidle', { timeout: 5000 });
|
||||||
|
|
||||||
await page.evaluate(getInjectableScript());
|
await page.evaluate(getInjectableScript());
|
||||||
return true;
|
return true;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -201,7 +201,7 @@ export class RemoteBrowser {
|
|||||||
const contextOptions: any = {
|
const contextOptions: any = {
|
||||||
viewport: { height: 400, width: 900 },
|
viewport: { height: 400, width: 900 },
|
||||||
// recordVideo: { dir: 'videos/' }
|
// recordVideo: { dir: 'videos/' }
|
||||||
// Force reduced motion to prevent animation issues
|
// Force reduced motion to prevent animation issues
|
||||||
reducedMotion: 'reduce',
|
reducedMotion: 'reduce',
|
||||||
// Force JavaScript to be enabled
|
// Force JavaScript to be enabled
|
||||||
javaScriptEnabled: true,
|
javaScriptEnabled: true,
|
||||||
@@ -249,7 +249,7 @@ export class RemoteBrowser {
|
|||||||
).get;
|
).get;
|
||||||
patchedGetter.apply(navigator);
|
patchedGetter.apply(navigator);
|
||||||
patchedGetter.toString();`
|
patchedGetter.toString();`
|
||||||
);
|
);
|
||||||
this.currentPage = await this.context.newPage();
|
this.currentPage = await this.context.newPage();
|
||||||
|
|
||||||
await this.setupPageEventListeners(this.currentPage);
|
await this.setupPageEventListeners(this.currentPage);
|
||||||
@@ -481,7 +481,7 @@ export class RemoteBrowser {
|
|||||||
this.currentPage = newPage;
|
this.currentPage = newPage;
|
||||||
if (this.currentPage) {
|
if (this.currentPage) {
|
||||||
await this.setupPageEventListeners(this.currentPage);
|
await this.setupPageEventListeners(this.currentPage);
|
||||||
|
|
||||||
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
|
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
|
||||||
await this.subscribeToScreencast();
|
await this.subscribeToScreencast();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user