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
The default allowlist for `geolocation` is `self`.
35
+
The default allowlist for `geolocation` is `self`. The top-level browsing context and same-origin iframes are allowed access to the `geolocation` feature by default.
40
36
41
37
## Examples
42
38
43
-
### General example
39
+
### Basic usage
44
40
45
-
SecureCorp Inc. wants to disable the Geolocation API within all browsing contexts
46
-
except for its own origin and those whose origin is `https://example.com`. It
47
-
can do so by delivering the following HTTP response header to define a Permissions Policy:
41
+
SecureCorp Inc. wants to disallow `geolocation` within all browsing contexts except for its own origin and those whose origin is `https://example.com`. It can do so by delivering the following HTTP response header to define a Permissions Policy:
Then include an {{HTMLElement('iframe','allow','#Attributes')}} attribute on the
64
-
`<iframe>` element:
53
+
> [!NOTE]
54
+
> Specifying the `Permissions-Policy` header in this manner disallows `geolocation` for other origins, even if they would be allowed by the `<iframe>``allow` attribute.
55
+
56
+
### Using the default policy
57
+
58
+
FastCorp Inc. wants to allow `geolocation` in a specific cross-origin child frame. Since the default allowlist for `geolocation` is `self`, it can do so by including an {{HTMLElement('iframe','allow','#Attributes')}} attribute on the `<iframe>` element:
0 commit comments