Skip to content

Commit

Permalink
Safelist distributed web schemes for "registerProtocolHandler"
Browse files Browse the repository at this point in the history
This CL adds "cabal", "dat", "did", "dweb", "ethereum", "hyper",
"ipfs", "ipns", "ssb" to the safelist of
navigator.registerProtocolHandler. Chrome status entry is [1]
and feature has been discussed in [2] [3] [4] [5]. Currently,
the WHATWG and WPT changes are pending on the Mozilla position
review [6].

[1] https://www.chromestatus.com/feature/4776602869170176
[2] https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/29sFh4tTdcs/K4XroilVBAAJ
[3] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/7nHTRUP1EGY
[4] whatwg/html#3935
[5] whatwg/html#3998
[6] mozilla/standards-positions#339

Bug: 651311
Change-Id: Iba45706e985015cf86bd80adef990abd0980a638
  • Loading branch information
fred-wang authored and chromium-wpt-export-bot committed Aug 19, 2020
1 parent 17ebc3a commit b81a70c
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<meta charset='utf-8'>
<title>protocol handlers</title>

<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>

<script>
// This should be merged into protocol.https.html when/if
// https://github.com/whatwg/html/pull/5482 is approved.
[
'cabal',
'dat',
'did',
'dweb',
'ethereum',
'hyper',
'ipfs',
'ipns',
'ssb',
].forEach(scheme => {
test(() => {
navigator.registerProtocolHandler(scheme, location.href + '/%s', "foo");
}, 'registerProtocolHandler: overriding the "' + scheme + '" protocol should work');

test(() => {
navigator.unregisterProtocolHandler(scheme, location.href + '/%s');
}, 'unregisterProtocolHandler: overriding the "' + scheme + '" protocol should work');
});
</script>

0 comments on commit b81a70c

Please sign in to comment.