-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Origin Policy: Add support for Feature Policy.
Bug: 751996 Change-Id: I969cd67059c6105f468dc56efe01c8de8869565b Reviewed-on: https://chromium-review.googlesource.com/c/1202202 Commit-Queue: Daniel Vogelheim <[email protected]> Reviewed-by: Mike West <[email protected]> Cr-Commit-Position: refs/heads/master@{#609331}
- Loading branch information
1 parent
becd4a7
commit f5eb262
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"feature-policy": [ | ||
"camera 'self' https://example.org", | ||
"geolocation https://example.org/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<script src='/resources/testharness.js'></script> | ||
<script src='/resources/testharnessreport.js'></script> | ||
</head> | ||
<body> | ||
<script> | ||
async_test(t => { | ||
assert_false(document.policy.allowsFeature('geolocation')); | ||
assert_true(document.policy.allowsFeature('camera')); | ||
t.done(); | ||
}, "Origin-Policy-based Feature policy"); | ||
</script> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
origin-policy/origin-policy-features.https.tentative.html.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sec-Origin-Policy: policy-features |