Skip to content

Commit

Permalink
Origin Policy: Add support for Feature Policy.
Browse files Browse the repository at this point in the history
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
otherdaniel authored and chromium-wpt-export-bot committed Nov 19, 2018
1 parent becd4a7 commit f5eb262
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .well-known/origin-policy/policy-features
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/"
]
}
16 changes: 16 additions & 0 deletions origin-policy/origin-policy-features.https.tentative.html
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sec-Origin-Policy: policy-features

0 comments on commit f5eb262

Please sign in to comment.