mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: worker convenience methods (#2677)
This patch: - adds `worker.evaluate` and `worker.evaluateHandle` methods as a shortcut to their execution context equivalents. - makes the error messages a bit nicer when interacting with a closed worker (as opposed to a closed page). - moves the worker tests into their own spec file.
This commit is contained in:
committed by
Andrey Lushnikov
parent
3e82a54fd1
commit
2ff0adcad8
@@ -107,7 +107,7 @@ class Browser extends EventEmitter {
|
||||
const {browserContextId} = targetInfo;
|
||||
const context = (browserContextId && this._contexts.has(browserContextId)) ? this._contexts.get(browserContextId) : this._defaultContext;
|
||||
|
||||
const target = new Target(targetInfo, context, () => this._connection.createSession(targetInfo.targetId), this._ignoreHTTPSErrors, this._setDefaultViewport, this._screenshotTaskQueue);
|
||||
const target = new Target(targetInfo, context, () => this._connection.createSession(targetInfo), this._ignoreHTTPSErrors, this._setDefaultViewport, this._screenshotTaskQueue);
|
||||
assert(!this._targets.has(event.targetInfo.targetId), 'Target should not exist before targetCreated');
|
||||
this._targets.set(event.targetInfo.targetId, target);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user