From 3732757450b4363041ccbacc3b236289a156abb0 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Wed, 31 Aug 2022 21:57:02 +0200 Subject: [PATCH] fix: allow getting a frame from an elementhandle (#8875) Libraries like pptr-testing-library and expect-puppeteer seem to rely on it. --- docs/api/puppeteer.elementhandle.frame.md | 13 +++++++++++++ docs/api/puppeteer.elementhandle.md | 6 ++++++ src/common/ElementHandle.ts | 3 --- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 docs/api/puppeteer.elementhandle.frame.md diff --git a/docs/api/puppeteer.elementhandle.frame.md b/docs/api/puppeteer.elementhandle.frame.md new file mode 100644 index 0000000000000..7ed68d2ba2850 --- /dev/null +++ b/docs/api/puppeteer.elementhandle.frame.md @@ -0,0 +1,13 @@ +--- +sidebar_label: ElementHandle.frame +--- + +# ElementHandle.frame property + +**Signature:** + +```typescript +class ElementHandle { + get frame(): Frame; +} +``` diff --git a/docs/api/puppeteer.elementhandle.md b/docs/api/puppeteer.elementhandle.md index 1255d13490606..5df3ec39491d1 100644 --- a/docs/api/puppeteer.elementhandle.md +++ b/docs/api/puppeteer.elementhandle.md @@ -39,6 +39,12 @@ If you're using TypeScript, ElementHandle takes a generic argument that denotes The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `ElementHandle` class. +## Properties + +| Property | Modifiers | Type | Description | +| ------------------------------------------- | --------------------- | ----------------------------- | ----------- | +| [frame](./puppeteer.elementhandle.frame.md) | readonly | [Frame](./puppeteer.frame.md) | | + ## Methods | Method | Modifiers | Description | diff --git a/src/common/ElementHandle.ts b/src/common/ElementHandle.ts index ed80b69bd0449..8cb19fa0428ff 100644 --- a/src/common/ElementHandle.ts +++ b/src/common/ElementHandle.ts @@ -88,9 +88,6 @@ export class ElementHandle< return this.#frame.page(); } - /** - * @internal - */ get frame(): Frame { return this.#frame; }