can connect to last page
This commit is contained in:
@@ -88,6 +88,17 @@ class CommandorPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async connect_to_browser(){
|
||||||
|
this.browser = await puppeteer.connect({
|
||||||
|
browserWSEndpoint: "ws://127.0.0.1:" + this.port + "/devtools/browser",
|
||||||
|
headless: false, defaultViewport: null
|
||||||
|
})
|
||||||
|
let pages = await this.browser.pages();
|
||||||
|
this.page = pages[pages.length - 1]
|
||||||
|
let content = await this.page.content()
|
||||||
|
console.log(content)
|
||||||
|
}
|
||||||
|
|
||||||
async loadPage() {
|
async loadPage() {
|
||||||
// Connect to the device.
|
// Connect to the device.
|
||||||
log("loadPage() called, with port:" + this.port);
|
log("loadPage() called, with port:" + this.port);
|
||||||
|
|||||||
Reference in New Issue
Block a user