playwright-core
Advanced tools
Comparing version 1.47.0 to 1.48.0-alpha-2024-09-06
@@ -37,4 +37,2 @@ "use strict"; | ||
if (options.__testHookOnConnectToBrowser) await options.__testHookOnConnectToBrowser(); | ||
const sessionStatus = await browser._browserSession.send('session.status', {}); | ||
if (!sessionStatus.ready) throw new Error('Bidi session is not ready. ' + sessionStatus.message); | ||
let proxy; | ||
@@ -41,0 +39,0 @@ if (options.proxy) { |
@@ -75,15 +75,6 @@ "use strict"; | ||
async _initialize() { | ||
const { | ||
contexts | ||
} = await this._session.send('browsingContext.getTree', { | ||
root: this._session.sessionId | ||
}); | ||
this._handleFrameTree(contexts[0]); | ||
// Initialize main frame. | ||
this._onFrameAttached(this._session.sessionId, null); | ||
await Promise.all([this.updateHttpCredentials(), this.updateRequestInterception(), this._updateViewport()]); | ||
} | ||
_handleFrameTree(frameTree) { | ||
this._onFrameAttached(frameTree.context, frameTree.parent || null); | ||
if (!frameTree.children) return; | ||
for (const child of frameTree.children) this._handleFrameTree(child); | ||
} | ||
potentiallyUninitializedPage() { | ||
@@ -90,0 +81,0 @@ return this._page; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.kNoXServerRunningError = exports.BrowserType = void 0; | ||
exports.kNoXServerRunningError = exports.BrowserType = exports.BrowserReadyState = void 0; | ||
var _fs = _interopRequireDefault(require("fs")); | ||
@@ -44,2 +44,18 @@ var os = _interopRequireWildcard(require("os")); | ||
const kNoXServerRunningError = exports.kNoXServerRunningError = 'Looks like you launched a headed browser without having a XServer running.\n' + 'Set either \'headless: true\' or use \'xvfb-run <your-playwright-app>\' before running Playwright.\n\n<3 Playwright Team'; | ||
class BrowserReadyState { | ||
constructor() { | ||
this._wsEndpoint = new _utils.ManualPromise(); | ||
} | ||
onBrowserExit() { | ||
// Unblock launch when browser prematurely exits. | ||
this._wsEndpoint.resolve(undefined); | ||
} | ||
async waitUntilReady() { | ||
const wsEndpoint = await this._wsEndpoint; | ||
return { | ||
wsEndpoint | ||
}; | ||
} | ||
} | ||
exports.BrowserReadyState = BrowserReadyState; | ||
class BrowserType extends _instrumentation.SdkObject { | ||
@@ -46,0 +62,0 @@ constructor(parent, browserName) { |
@@ -305,6 +305,3 @@ "use strict"; | ||
exports.Chromium = Chromium; | ||
class ChromiumReadyState { | ||
constructor() { | ||
this._wsEndpoint = new _manualPromise.ManualPromise(); | ||
} | ||
class ChromiumReadyState extends _browserType.BrowserReadyState { | ||
onBrowserOutput(message) { | ||
@@ -314,11 +311,2 @@ const match = message.match(/DevTools listening on (.*)/); | ||
} | ||
onBrowserExit() { | ||
this._wsEndpoint.resolve(undefined); | ||
} | ||
async waitUntilReady() { | ||
const wsEndpoint = await this._wsEndpoint; | ||
return { | ||
wsEndpoint | ||
}; | ||
} | ||
} | ||
@@ -325,0 +313,0 @@ async function urlToWSEndpoint(progress, endpointURL, headers) { |
@@ -95,17 +95,6 @@ "use strict"; | ||
exports.Firefox = Firefox; | ||
class JugglerReadyState { | ||
constructor() { | ||
this._jugglerPromise = new _utils.ManualPromise(); | ||
} | ||
class JugglerReadyState extends _browserType.BrowserReadyState { | ||
onBrowserOutput(message) { | ||
if (message.includes('Juggler listening to the pipe')) this._jugglerPromise.resolve(); | ||
if (message.includes('Juggler listening to the pipe')) this._wsEndpoint.resolve(undefined); | ||
} | ||
onBrowserExit() { | ||
// Unblock launch when browser prematurely exits. | ||
this._jugglerPromise.resolve(); | ||
} | ||
async waitUntilReady() { | ||
await this._jugglerPromise; | ||
return {}; | ||
} | ||
} |
@@ -18,3 +18,3 @@ "use strict"; | ||
var _debugController = require("./debugController"); | ||
var _bidiFirefox = require("./bidi/bidiFirefox"); | ||
var _bidiBrowserType = require("./bidi/bidiBrowserType"); | ||
/** | ||
@@ -65,3 +65,3 @@ * Copyright (c) Microsoft Corporation. | ||
this.chromium = new _chromium.Chromium(this); | ||
this.bidi = new _bidiFirefox.BidiFirefox(this); | ||
this.bidi = new _bidiBrowserType.BidiBrowserType(this); | ||
this.firefox = new _firefox.Firefox(this); | ||
@@ -68,0 +68,0 @@ this.webkit = new _webkit.WebKit(this); |
@@ -450,2 +450,7 @@ "use strict"; | ||
})); | ||
this._executables.push(this._createBidiChannel('bidi-chrome-canary', { | ||
'linux': '', | ||
'darwin': '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary', | ||
'win32': `\\Google\\Chrome SxS\\Application\\chrome.exe` | ||
})); | ||
const firefox = descriptors.find(d => d.name === 'firefox'); | ||
@@ -452,0 +457,0 @@ const firefoxExecutable = findExecutablePath(firefox.dir, 'firefox'); |
{ | ||
"name": "playwright-core", | ||
"version": "1.47.0", | ||
"version": "1.48.0-alpha-2024-09-06", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
7531050
323
106039
3
184