Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(evaluate): clarify exposeFunctions scope and lifetime (#41856)

Pavel Feldman37b39b798589
diff --git a/docs/src/api/params.md b/docs/src/api/params.md
index 6a92a8474a..bdce536658 100644
--- a/docs/src/api/params.md
+++ b/docs/src/api/params.md
@@ -588,7 +588,7 @@ Function to be evaluated in the page context.
* langs: js
- `exposeFunctions` <[boolean]>
-When set to `true`, functions passed inside [`param: arg`] are exposed in the page and can be called from the page function. Calling one returns a [Promise] of its result. The page-side functions are scoped to the execution context they were passed to and disappear when the page navigates. Defaults to `false`, in which case functions are not serializable and passing one throws an error, as before.
+When set to `true`, functions passed inside [`param: arg`] are exposed in the page and can be called from the page function. Calling one returns a [Promise] of its result. Under the hood, each function is exposed via [`method: Page.exposeFunction`], so it is technically accessible from all frames and worlds of the page. Exposed functions are cleared upon the top-level navigation. Defaults to `false`, in which case functions are not serializable and passing one throws an error.
## js-evalonselector-pagefunction
* langs: js