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
thrownewError(`Browser geolocation permission must be ${[...BROWSER_GEOLOCATION_PERMISSION_STATES, ...BROWSER_GEOLOCATION_PERMISSION_ALIASES].join(", ")}: ${value}`)
if(!Number.isFinite(input.latitude)||input.latitude<-90||input.latitude>90)thrownewError("Browser geolocation latitude must be a finite number between -90 and 90.")
42
+
if(!Number.isFinite(input.longitude)||input.longitude<-180||input.longitude>180)thrownewError("Browser geolocation longitude must be a finite number between -180 and 180.")
43
+
if(input.accuracy!==undefined&&(!Number.isFinite(input.accuracy)||input.accuracy<0||input.accuracy>BROWSER_GEOLOCATION_MAX_ACCURACY_METERS))thrownewError(`Browser geolocation accuracy must be a finite number between 0 and ${BROWSER_GEOLOCATION_MAX_ACCURACY_METERS}.`)
{name: "timezone",description: "Optional browser context timezone.",format: "IANA timezone, e.g. America/New_York"},
50
81
{name: "user-agent",description: "Optional browser context user agent override.",format: "string"},
51
82
{name: "permissions",description: "Comma-separated browser permissions to grant to the context.",format: "comma-separated permission names"},
83
+
{name: "geolocation-latitude",description: "Browser context geolocation latitude.",format: "finite number from -90 to 90"},
84
+
{name: "geolocation-longitude",description: "Browser context geolocation longitude.",format: "finite number from -180 to 180"},
85
+
{name: "geolocation-accuracy",description: "Optional browser context geolocation accuracy in meters.",format: `finite number from 0 to ${BROWSER_GEOLOCATION_MAX_ACCURACY_METERS}`},
86
+
{name: "geolocation-permission",description: "Explicit browser context geolocation permission state. default is normalized to prompt.",format: [...BROWSER_GEOLOCATION_PERMISSION_STATES, ...BROWSER_GEOLOCATION_PERMISSION_ALIASES].join("|")},
52
87
{name: "throttle",description: "Optional Chromium/CDP throttle profile, or none.",format: `none|${BROWSER_PROBE_THROTTLE_PROFILE_IDS.join("|")}`},
53
88
{name: "auth",description: "Optional in-memory browser authentication mode. Use wordpress-admin to bootstrap WordPress admin cookies from PHP without writing token-bearing storage-state artifacts.",format: "wordpress-admin"},
54
89
{name: "auth-user-id",description: "WordPress user ID used with auth=wordpress-admin; defaults to 1.",format: "positive integer"},
{name: "throttle",kind: "enum",values: ["none", ...BROWSER_PROBE_THROTTLE_PROFILE_IDS],code: "invalid-throttle",message: "wordpress.browser-probe throttle is unsupported"},
128
129
{name: "browser",kind: "enum",values: BROWSER_PROBE_BROWSER_VALUES,code: "invalid-browser",message: `wordpress.browser-probe browser must be ${BROWSER_PROBE_BROWSER_VALUES.join(" or ")}.`},
129
130
{name: "viewport",kind: "viewport",code: "invalid-viewport",message: "wordpress.browser-probe viewport must use <width>x<height>, for example 390x844."},
131
+
{name: "geolocation-latitude",kind: "number",minimum: -90,maximum: 90,code: "invalid-geolocation-latitude",message: "wordpress.browser-probe geolocation-latitude must be a finite number from -90 to 90."},
132
+
{name: "geolocation-longitude",kind: "number",minimum: -180,maximum: 180,code: "invalid-geolocation-longitude",message: "wordpress.browser-probe geolocation-longitude must be a finite number from -180 to 180."},
133
+
{name: "geolocation-accuracy",kind: "number",minimum: 0,maximum: BROWSER_GEOLOCATION_MAX_ACCURACY_METERS,code: "invalid-geolocation-accuracy",message: `wordpress.browser-probe geolocation-accuracy must be a finite number from 0 to ${BROWSER_GEOLOCATION_MAX_ACCURACY_METERS}.`},
134
+
{name: "geolocation-permission",kind: "enum",values: [...BROWSER_GEOLOCATION_PERMISSION_STATES, ...BROWSER_GEOLOCATION_PERMISSION_ALIASES],code: "invalid-geolocation-permission",message: "wordpress.browser-probe geolocation-permission must be granted, denied, prompt, or default."},
130
135
{name: "capture",kind: "comma-list-enum",values: BROWSER_PROBE_CAPTURE_VALUES,code: "invalid-capture",message: "wordpress.browser-probe capture does not support"},
if(requested.zoom!==undefined)emulated("browser.environment.zoom","Applied as page scale through the browser debugging protocol; OS-level zoom and browser chrome are outside the page context.")
88
94
if(requested.networkProfile)options.networkProfiles?.[requested.networkProfile] ? emulated("browser.environment.network-profile","Latency and throughput are applied through the browser debugging protocol.") : unsupported("browser.environment.network-profile",`Unknown network profile: ${requested.networkProfile}`)
@@ -114,11 +120,22 @@ export async function createPlaywrightBrowserEnvironmentContext(browser: Browser
if(page.context().browser()?.browserType().name()!=="chromium")thrownewError("Explicit denied geolocation permission is unsupported by this browser provider.")
0 commit comments