Bug 1688030 - Safelist matrix scheme. r=emilio
authorMayeul Cantan <oss+mozilla@mayeul.net>
Thu, 22 Apr 2021 15:33:43 +0000
changeset 577105 d74679a8ad9d494b3390379c326a2259de890b85
parent 577104 a08a2e0aee433f806f3b7420ff50b62fc0ba0412
child 577106 6201e2084cc35bc7f04fc31bdf03fe991319ba43
push id38400
push userimoraru@mozilla.com
push dateFri, 23 Apr 2021 09:51:01 +0000
treeherdermozilla-central@9b7bac5af873 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1688030 - Safelist matrix scheme. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D113023
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -859,19 +859,19 @@ uint32_t Navigator::MaxTouchPoints(Calle
 //    Navigator::nsIDOMClientInformation
 // This list should be kept up-to-date with the spec:
 // https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
 // If you change this list, please also update the copy in E10SUtils.jsm.
 static const char* const kSafeSchemes[] = {
-    "bitcoin", "geo",  "im",   "irc",         "ircs", "magnet", "mailto",
-    "mms",     "news", "nntp", "openpgp4fpr", "sip",  "sms",    "smsto",
-    "ssh",     "tel",  "urn",  "webcal",      "wtai", "xmpp"};
+    "bitcoin", "geo", "im",   "irc",  "ircs",        "magnet", "mailto",
+    "matrix",  "mms", "news", "nntp", "openpgp4fpr", "sip",    "sms",
+    "smsto",   "ssh", "tel",  "urn",  "webcal",      "wtai",   "xmpp"};
 void Navigator::CheckProtocolHandlerAllowed(const nsAString& aScheme,
                                             nsIURI* aHandlerURI,
                                             nsIURI* aDocumentURI,
                                             ErrorResult& aRv) {
   auto raisePermissionDeniedHandler = [&] {
     nsAutoCString spec;
--- a/toolkit/components/extensions/schemas/extension_protocol_handlers.json
+++ b/toolkit/components/extensions/schemas/extension_protocol_handlers.json
@@ -12,17 +12,17 @@
             "type": "string"
           "protocol": {
             "description": "The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the \"sms\" scheme.",
             "choices": [{
               "type": "string",
               "enum": [
                 "bitcoin", "dat", "dweb", "ftp", "geo", "gopher", "im", "ipfs", "ipns", "irc", "ircs", "magnet",
-                "mailto", "mms", "news", "nntp", "sip", "sms", "smsto", "ssb", "ssh",
+                "mailto", "matrix", "mms", "news", "nntp", "sip", "sms", "smsto", "ssb", "ssh",
                 "tel", "urn", "webcal", "wtai", "xmpp"
             }, {
               "type": "string",
               "pattern": "^(ext|web)\\+[a-z0-9.+-]+$"
           "uriTemplate": {
--- a/toolkit/modules/E10SUtils.jsm
+++ b/toolkit/modules/E10SUtils.jsm
@@ -102,16 +102,17 @@ const DEFAULT_REMOTE_TYPE = WEB_REMOTE_T
 const kSafeSchemes = [
+  "matrix",