fix: add on load emit urlChanged
This commit is contained in:
@@ -402,14 +402,14 @@ export class RemoteBrowser {
|
|||||||
await this.currentPage?.close();
|
await this.currentPage?.close();
|
||||||
this.currentPage = newPage;
|
this.currentPage = newPage;
|
||||||
if (this.currentPage) {
|
if (this.currentPage) {
|
||||||
this.currentPage.on('framenavigated', (frame) => {
|
// this.currentPage.on('framenavigated', (frame) => {
|
||||||
if (frame === this.currentPage?.mainFrame()) {
|
// if (frame === this.currentPage?.mainFrame()) {
|
||||||
this.socket.emit('urlChanged', this.currentPage.url());
|
// this.socket.emit('urlChanged', this.currentPage.url());
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
// this.currentPage.on('load', (page) => {
|
this.currentPage.on('load', (page) => {
|
||||||
// this.socket.emit('urlChanged', page.url());
|
this.socket.emit('urlChanged', page.url());
|
||||||
// })
|
})
|
||||||
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