forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Safelist distributed web schemes for "registerProtocolHandler"
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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153064 Reviewed-by: Mike West <[email protected]> Reviewed-by: Dominick Ng <[email protected]> Commit-Queue: Frédéric Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#799626}
- Loading branch information
Showing
4 changed files
with
56 additions
and
6 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
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
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
30 changes: 30 additions & 0 deletions
30
...bappapis/system-state-and-capabilities/the-navigator-object/protocol.tentative.https.html
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,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> |