Bug 1398762 Fix unparseable host permission warning r=mixedpuppy
authorAndrew Swan <aswan@mozilla.com>
Fri, 27 Oct 2017 17:07:29 -0700
changeset 443836 f3fe7b47cdacd5e4c5e7d8e52511fe4a71956ffb
parent 443835 f0b47601baec03c6841615488c87c438d5a11dfd
child 443837 ec6b9fda18680e405d9c65f4486c2b382d20bf23
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1398762
milestone58.0a1
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 1398762 Fix unparseable host permission warning r=mixedpuppy MozReview-Commit-ID: B2YALdhEKJs
toolkit/components/extensions/Extension.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -846,17 +846,20 @@ this.ExtensionData = class {
 
     // First classify our host permissions
     let allUrls = false, wildcards = new Set(), sites = new Set();
     for (let permission of perms.origins) {
       if (permission == "<all_urls>") {
         allUrls = true;
         break;
       }
-      let match = /^[htps*]+:\/\/([^/]+)\//.exec(permission);
+      if (permission.startsWith("moz-extension:")) {
+        continue;
+      }
+      let match = /^https?:\/\/([^/]+)\//.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));