registerProtocolHandler(): handler's URL cannot be a blob URL
For https://github.com/whatwg/html/pull/5530.
diff --git a/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html b/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
index d8b3e55..d8e064d 100644
--- a/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
+++ b/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
@@ -59,7 +59,7 @@
test(() => {
assert_throws_dom('SYNTAX_ERR', () => { navigator.unregisterProtocolHandler('mailto', url); });
- assert_throws_dom('SECURITY_ERR', () => { navigator.registerProtocolHandler('x', url, 'foo'); });
+ assert_throws_dom('SECURITY_ERR', () => { navigator.unregisterProtocolHandler('x', url, 'foo'); });
}, `unregisterProtocolHandler: Invalid URL "${url}" should throw (but after scheme)`);
});
@@ -74,14 +74,16 @@
`ftp://${location.host}/%s`,
`chrome://${location.host}/%s`,
`foo://${location.host}/%s`,
+ URL.createObjectURL(new Blob()) + "#%s",
].forEach(url => {
+ const title = url.startsWith("blob:") ? "blob: URL" : url;
test(() => {
assert_throws_dom('SECURITY_ERR', () => { navigator.registerProtocolHandler('mailto', url, 'foo'); });
- }, 'registerProtocolHandler: Invalid URL "' + url + '" should throw SECURITY_ERR.');
+ }, `registerProtocolHandler: Invalid URL "${title}" should throw SECURITY_ERR.`);
test(() => {
assert_throws_dom('SECURITY_ERR', () => { navigator.unregisterProtocolHandler('mailto', url); });
- }, 'unregisterProtocolHandler: Invalid URL "' + url + '" should throw SECURITY_ERR.');
+ }, `unregisterProtocolHandler: Invalid URL "${title}" should throw SECURITY_ERR.`);
});
/* Protocol argument */