{"id":"c17152a2-358d-41d6-a97d-10e22b038ca5","task":"grant a specific permission and set device geolocation in puppeteer using browsercontext setpermission and page setgeolocation","domain":"pptr.dev","steps":["get the target browser context, e.g. browser.defaultBrowserContext(), and call context.setPermission(origin, permissionName, state) to grant (or deny) a single permission such as 'geolocation' for that origin","call page.setGeolocation({ latitude, longitude }) on a page navigated to that same origin to set the coordinates the browser reports","navigate to the page and trigger the app's geolocation request, confirming it resolves immediately without a native permission prompt","use context.clearPermissionOverrides() to reset permission state between tests that need different grant/deny scenarios","avoid the older context.overridePermissions() method for new code, since it is marked obsolete in favor of setPermission()"],"gotchas":["BrowserContext.overridePermissions() is now marked obsolete in current Puppeteer docs in favor of the per-permission setPermission() method, so new automation should not rely on it","page.setGeolocation() only affects what coordinates are reported once permission is granted -- it does not itself grant the permission, so both calls are required together"],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/c17152a2-358d-41d6-a97d-10e22b038ca5"}