Feature Policy JS API: does not return correct values when specifying multiple origins values |
||
Issue descriptionChrome Version: 69.0.3488.0 (Official Build) canary (64-bit) OS: macOS What steps will reproduce the problem? (1) Send a policy header of: Feature-Policy: geolocation 'self' https://example.com What is the expected result? The JS API returns https://example.com as an allowed origin for geolocation. What happens instead? The API returns the self origin as the only allowed origin: document.policy.getAllowlistForFeature('geolocation') // ["http://localhost:8080"] document.policy.allowsFeature('geolocation', 'https://example.com') // false
,
Jul 24
Interesting. Cause this test https://github.com/web-platform-tests/wpt/blob/master/feature-policy/feature-policy-header-policy-allowed-for-some.https.sub.html tests exactly what the behavior is described above and works. I will look more into it. Thanks
,
Jul 24
https://maple-light.glitch.me/ repros for me.
,
Jul 24
I tried to reproduce locally. hosting server you provided and locally built chrome with --no-sandbox flag, Experimental Web Platform features enabled, I get the correct result.
,
Jul 24
Chatted with ericbidelman@ offline. Seems like things are working as expected. Closing this bug.
,
Jul 24
Just to loop back. It looks like the issue was with my Feature Policy DevTools extension getting. Opening the test page in an incognito window returns correct values. What's happening is that I get the browser's supported feature policies by running `document.policy.allowedFeatures()` on about:blank. This of course doesn't have https://example.com as an allowed origin for the geolocation so this ends up overriding what the page originally set for the policy. |
||
►
Sign in to add a comment |
||
Comment 1 by cha...@chromium.org
, Jul 24Owner: loonyb...@chromium.org