Bug 1426363 Fix host permission parsing for permission strings r=rpl a=gchang
authorAndrew Swan <aswan@mozilla.com>
Thu, 21 Dec 2017 11:37:34 -0800
changeset 443101 50a2c8cc35fdd51376e75dc1c2f234c800536188
parent 443100 fbd13ed0bedf95c6b4af43def0d1a7700186eefe
child 443102 73aaf7087ce032f624e634f2ddf27a4e8ea6ec0b
push id8479
push userarchaeopteryx@coole-files.de
push dateFri, 05 Jan 2018 16:38:26 +0000
treeherdermozilla-beta@50a2c8cc35fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl, gchang
bugs1426363
milestone58.0
Bug 1426363 Fix host permission parsing for permission strings r=rpl a=gchang MozReview-Commit-ID: BeisQwgKak9
toolkit/components/extensions/Extension.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -839,17 +839,17 @@ this.ExtensionData = class {
     for (let permission of perms.origins) {
       if (permission == "<all_urls>") {
         allUrls = true;
         break;
       }
       if (permission.startsWith("moz-extension:")) {
         continue;
       }
-      let match = /^https?:\/\/([^/]+)\//.exec(permission);
+      let match = /^[a-z*]+:\/\/([^/]+)\//.exec(permission);
       if (!match) {
         Cu.reportError(`Unparseable host permission ${permission}`);
         continue;
       }
       if (match[1] == "*") {
         allUrls = true;
       } else if (match[1].startsWith("*.")) {
         wildcards.add(match[1].slice(2));