You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavaScript extensions get the string "RESERVED" instead of null or undefined when there is no page, context or browser #5320
Describe the bug
A JavaScript extension function that requests page, context or browser receives the string "RESERVED" when that value does not exist. For example: no page is open, or browser is requested while a persistent context is active, where the browser is null.
Python sends ("page", "RESERVED") as a placeholder for every injected argument, and extensionKeywordCall in node/playwright-wrapper/playwright-state.ts replaced it like this:
When the real value is null or undefined, || falls back to the placeholder, so the extension gets "RESERVED". A guard such as if (!page) therefore never worked, because the string is truthy.
Fix
Fixed in #5318: injected values are passed on as they are, with apiArguments.has(argName) ? apiArguments.get(argName) : namedArguments[argName]. The extension now receives null or undefined.
Release notes
This is a behaviour change for JavaScript extensions. An extension that runs without a page, context or browser now gets null or undefined instead of the string "RESERVED". Only code that compared against the undocumented "RESERVED" marker is affected.
Found while reviewing #5318 (adoptContext, #5317), where browser is null for an adopted context.
Activity
aaltat commentedon Oct 11, 2026
#5318 is merged, closing.