playwright-core
Advanced tools
Comparing version 0.11.1-next.1583193743037 to 0.11.1-next.1583204591163
@@ -83,3 +83,3 @@ "use strict"; | ||
const event = new page_1.PageEvent(page); | ||
context.emit(events_2.Events.BrowserContext.PageEvent, event); | ||
context.emit(events_2.Events.BrowserContext.Page, event); | ||
break; | ||
@@ -86,0 +86,0 @@ } |
@@ -23,3 +23,3 @@ /** | ||
Close: string; | ||
PageEvent: string; | ||
Page: string; | ||
}; | ||
@@ -26,0 +26,0 @@ BrowserServer: { |
@@ -25,3 +25,3 @@ "use strict"; | ||
Close: 'close', | ||
PageEvent: 'page', | ||
Page: 'page', | ||
}, | ||
@@ -28,0 +28,0 @@ BrowserServer: { |
@@ -61,3 +61,3 @@ /** | ||
private readonly _openerId; | ||
constructor(connection: any, browser: FFBrowser, context: BrowserContext, targetId: string, type: 'page' | 'browser', url: string, openerId: string | undefined); | ||
constructor(connection: any, browser: FFBrowser, context: FFBrowserContext, targetId: string, type: 'page' | 'browser', url: string, openerId: string | undefined); | ||
_didClose(): void; | ||
@@ -67,3 +67,3 @@ opener(): Target | null; | ||
url(): string; | ||
context(): BrowserContext; | ||
context(): FFBrowserContext; | ||
page(): Promise<Page>; | ||
@@ -70,0 +70,0 @@ _initPagePromise(session: FFSession): void; |
@@ -24,2 +24,3 @@ "use strict"; | ||
const network = require("../network"); | ||
const page_1 = require("../page"); | ||
const ffConnection_1 = require("./ffConnection"); | ||
@@ -144,9 +145,11 @@ const ffPage_1 = require("./ffPage"); | ||
target._initPagePromise(this._connection.getSession(payload.sessionId)); | ||
const page = await target.page(); | ||
if (!page) | ||
return; | ||
target.context().emit(events_1.Events.BrowserContext.Page, new page_1.PageEvent(page)); | ||
const opener = target.opener(); | ||
if (opener && opener._pagePromise) { | ||
const openerPage = await opener._pagePromise; | ||
if (openerPage.listenerCount(events_1.Events.Page.Popup)) { | ||
const popupPage = await target.page(); | ||
openerPage.emit(events_1.Events.Page.Popup, popupPage); | ||
} | ||
if (openerPage.listenerCount(events_1.Events.Page.Popup)) | ||
openerPage.emit(events_1.Events.Page.Popup, page); | ||
} | ||
@@ -153,0 +156,0 @@ } |
@@ -60,3 +60,3 @@ "use strict"; | ||
const browser = await crBrowser_1.CRBrowser.connect(transport); | ||
const firstPage = new Promise(r => browser._defaultContext.once(events_1.Events.BrowserContext.PageEvent, r)); | ||
const firstPage = new Promise(r => browser._defaultContext.once(events_1.Events.BrowserContext.Page, r)); | ||
await helper_1.helper.waitWithTimeout(firstPage, 'first page', timeout); | ||
@@ -63,0 +63,0 @@ // Hack: for typical launch scenario, ensure that close waits for actual process termination. |
@@ -23,2 +23,3 @@ "use strict"; | ||
const network = require("../network"); | ||
const page_1 = require("../page"); | ||
const transport_1 = require("../transport"); | ||
@@ -88,3 +89,3 @@ const events_1 = require("../events"); | ||
// lifecycle events. | ||
context = this._contexts.get(pageProxyInfo.browserContextId); | ||
context = this._contexts.get(pageProxyInfo.browserContextId) || null; | ||
} | ||
@@ -105,2 +106,13 @@ if (!context && !this._attachToDefaultContext) | ||
} | ||
pageProxy.page().then(async (page) => { | ||
if (!page) | ||
return; | ||
context.emit(events_1.Events.BrowserContext.Page, new page_1.PageEvent(page)); | ||
if (!opener) | ||
return; | ||
const openerPage = await opener.page(); | ||
if (!openerPage || page.isClosed()) | ||
return; | ||
openerPage.emit(events_1.Events.Page.Popup, page); | ||
}).catch(helper_1.debugError); // Just not emit the event in case of initialization failure. | ||
} | ||
@@ -107,0 +119,0 @@ _onPageProxyDestroyed(event) { |
@@ -18,4 +18,4 @@ /** | ||
import { Protocol } from './protocol'; | ||
import { WKBrowserContext } from './wkBrowser'; | ||
import { WKSession } from './wkConnection'; | ||
import { WKBrowserContext } from './wkBrowser'; | ||
export declare class WKPageProxy { | ||
@@ -22,0 +22,0 @@ private readonly _pageProxySession; |
@@ -18,6 +18,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const helper_1 = require("../helper"); | ||
const wkConnection_1 = require("./wkConnection"); | ||
const wkPage_1 = require("./wkPage"); | ||
const helper_1 = require("../helper"); | ||
const events_1 = require("../events"); | ||
const isPovisionalSymbol = Symbol('isPovisional'); | ||
@@ -107,2 +106,4 @@ class WKPageProxy { | ||
} | ||
if (targetInfo.isPaused) | ||
this._resumeTarget(targetInfo.targetId); | ||
if (error) | ||
@@ -112,11 +113,2 @@ this._pagePromiseReject(error); | ||
this._pagePromiseFulfill(page); | ||
if (targetInfo.isPaused) | ||
this._resumeTarget(targetInfo.targetId); | ||
if (page && this._opener) { | ||
this._opener.page().then(openerPage => { | ||
if (!openerPage || page.isClosed()) | ||
return; | ||
openerPage.emit(events_1.Events.Page.Popup, page); | ||
}); | ||
} | ||
} | ||
@@ -123,0 +115,0 @@ else { |
{ | ||
"name": "playwright-core", | ||
"version": "0.11.1-next.1583193743037", | ||
"version": "0.11.1-next.1583204591163", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -35,3 +35,2 @@ "repository": "github:Microsoft/playwright", | ||
"watch": "node utils/runWebpack.js --mode='development' --watch --silent | tsc -w -p .", | ||
"apply-next-version": "node utils/apply_next_version.js", | ||
"version": "node utils/sync_package_versions.js && npm run doc" | ||
@@ -38,0 +37,0 @@ }, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2424044
57016