Bug 1343498: Don't fail on unparseable host permissions r?kmag draft
authorAndrew Swan <aswan@mozilla.com>
Fri, 14 Apr 2017 16:45:10 -0700
changeset 563093 4a226b6d3648ce5a582ad1c7cace449cd7f5f125
parent 562811 cda24082bff8864a6e53726feeae33cae9e17309
child 624388 143ee7474752e7c7ff0c5a8425d7581918e8655d
push id54204
push useraswan@mozilla.com
push dateFri, 14 Apr 2017 23:46:11 +0000
reviewerskmag
bugs1343498
milestone55.0a1
Bug 1343498: Don't fail on unparseable host permissions r?kmag MozReview-Commit-ID: BHIzjjz23N7
browser/modules/ExtensionsUI.jsm
--- a/browser/modules/ExtensionsUI.jsm
+++ b/browser/modules/ExtensionsUI.jsm
@@ -242,17 +242,18 @@ this.ExtensionsUI = {
     let allUrls = false, wildcards = [], sites = [];
     for (let permission of perms.origins) {
       if (permission == "<all_urls>") {
         allUrls = true;
         break;
       }
       let match = /^[htps*]+:\/\/([^/]+)\//.exec(permission);
       if (!match) {
-        throw new Error("Unparseable host permission");
+        Cu.reportError(`Unparseable host permission ${permission}`);
+        continue;
       }
       if (match[1] == "*") {
         allUrls = true;
       } else if (match[1].startsWith("*.")) {
         wildcards.push(match[1].slice(2));
       } else {
         sites.push(match[1]);
       }