Skip to content

Commit eb856ad

Browse files
WebShare: Introduce web-share feature policy
share() requests fail with a rejected promise if the 'web-share' feature is not enabled. We define 'self' as the default feature policy for web-share. The spec has been updated w3c/web-share#166 Intent to Ship https://groups.google.com/a/chromium.org/g/blink-dev/c/fgme9KOd8CU/m/TCYPKQAXAwAJ Bug: 1079104 Change-Id: Id4030448a54589eddb45185cbd6fd8970aee34c3
1 parent 8ba782c commit eb856ad

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>WebShare Test: Can be disabled by feature policy</title>
6+
<script src="/resources/testharness.js"></script>
7+
<script src="/resources/testharnessreport.js"></script>
8+
<script src="/resources/testdriver.js"></script>
9+
<script src="/resources/testdriver-vendor.js"></script>
10+
</head>
11+
<body>
12+
<script>
13+
promise_test(async t => {
14+
await test_driver.bless("web share");
15+
16+
await promise_rejects_dom(t, "NotAllowedError", navigator.share({title: 'the title', text: 'the message'}));
17+
}, "share can be disabled by feature policy");
18+
</script>
19+
</body>
20+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Feature-Policy: web-share 'none'

0 commit comments

Comments
 (0)