Skip to content

🎥 Make videos programmatically with React

query objects

Jonny Burger12bf469d60f8
diff --git a/packages/renderer/src/browser/ExecutionContext.ts b/packages/renderer/src/browser/ExecutionContext.ts
index b81739d4cc..5a440be3d6 100644
--- a/packages/renderer/src/browser/ExecutionContext.ts
+++ b/packages/renderer/src/browser/ExecutionContext.ts
@@ -360,40 +360,6 @@ export class ExecutionContext {
}
}
- /**
- * This method iterates the JavaScript heap and finds all the objects with the
- * given prototype.
- * @remarks
- * @example
- * ```js
- * // Create a Map object
- * await page.evaluate(() => window.map = new Map());
- * // Get a handle to the Map object prototype
- * const mapPrototype = await page.evaluateHandle(() => Map.prototype);
- * // Query all map instances into an array
- * const mapInstances = await page.queryObjects(mapPrototype);
- * // Count amount of map objects in heap
- * const count = await page.evaluate(maps => maps.length, mapInstances);
- * await mapInstances.dispose();
- * await mapPrototype.dispose();
- * ```
- *
- * @param prototypeHandle - a handle to the object prototype
- *
- * @returns A handle to an array of objects with the given prototype.
- */
- async queryObjects(prototypeHandle: JSHandle): Promise<JSHandle> {
- assert(!prototypeHandle._disposed, 'Prototype JSHandle is disposed!');
- assert(
- prototypeHandle._remoteObject.objectId,
- 'Prototype JSHandle must not be referencing primitive value'
- );
- const response = await this._client.send('Runtime.queryObjects', {
- prototypeObjectId: prototypeHandle._remoteObject.objectId,
- });
- return _createJSHandle(this, response.objects);
- }
-
/**
* @internal
*/
diff --git a/packages/renderer/src/browser/Page.ts b/packages/renderer/src/browser/Page.ts
index ea6ccefc4f..8016dda78b 100644
--- a/packages/renderer/src/browser/Page.ts
+++ b/packages/renderer/src/browser/Page.ts
@@ -690,38 +690,6 @@ export class Page extends EventEmitter {
return context.evaluateHandle<HandlerType>(pageFunction, ...args);
}
- /**
- * This method iterates the JavaScript heap and finds all objects with the
- * given prototype.
- *
- * @remarks
- * Shortcut for
- * {@link ExecutionContext.queryObjects |
- * page.mainFrame().executionContext().queryObjects(prototypeHandle)}.
- *
- * @example
- *
- * ```js
- * // Create a Map object
- * await page.evaluate(() => window.map = new Map());
- * // Get a handle to the Map object prototype
- * const mapPrototype = await page.evaluateHandle(() => Map.prototype);
- * // Query all map instances into an array
- * const mapInstances = await page.queryObjects(mapPrototype);
- * // Count amount of map objects in heap
- * const count = await page.evaluate(maps => maps.length, mapInstances);
- * await mapInstances.dispose();
- * await mapPrototype.dispose();
- * ```
- * @param prototypeHandle - a handle to the object prototype.
- * @returns Promise which resolves to a handle to an array of objects with
- * this prototype.
- */
- async queryObjects(prototypeHandle: JSHandle): Promise<JSHandle> {
- const context = await this.mainFrame().executionContext();
- return context.queryObjects(prototypeHandle);
- }
-
#handleException(exceptionDetails: Protocol.Runtime.ExceptionDetails): void {
const message = getExceptionMessage(exceptionDetails);
const err = new Error(message);