bug 1354342 allow a relativeUrl for homepage r=mixedpuppy
☠☠ backed out by 1872baf8c37e ☠ ☠
authorAndy McKay <amckay@mozilla.com>
Thu, 06 Apr 2017 17:12:57 -0700
changeset 558314 0a3044dc01d20b60a8e0c8bae6fdebda3e30569f
parent 558313 b66ff847e1c581f355c2fbb94b54c220be2096d6
child 558315 feccac6975aec2ad24f8313d5229ddef04737399
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +0000
reviewersmixedpuppy
bugs1354342
milestone55.0a1
bug 1354342 allow a relativeUrl for homepage r=mixedpuppy MozReview-Commit-ID: 86V6vFjO66C
browser/components/extensions/schemas/chrome_settings_overrides.json
browser/components/extensions/test/browser/browser_ext_url_overrides_home.js
--- a/browser/components/extensions/schemas/chrome_settings_overrides.json
+++ b/browser/components/extensions/schemas/chrome_settings_overrides.json
@@ -7,19 +7,19 @@
         "properties": {
           "chrome_settings_overrides": {
             "type": "object",
             "optional": true,
             "additionalProperties": { "$ref": "UnrecognizedProperty" },
             "properties": {
               "homepage": {
                 "type": "string",
-                "format": "url",
+                "format": "relativeUrl",
                 "optional": true,
                 "preprocess": "localize"
               }
             }
           }
         }
       }
     ]
   }
-]
\ No newline at end of file
+]
--- a/browser/components/extensions/test/browser/browser_ext_url_overrides_home.js
+++ b/browser/components/extensions/test/browser/browser_ext_url_overrides_home.js
@@ -177,8 +177,27 @@ add_task(function* test_disable() {
 
   prefPromise = promisePrefChangeObserved("browser.startup.homepage");
   yield ext1.unload();
   yield prefPromise;
 
   is(Preferences.get("browser.startup.homepage"), defaultHomePage,
      "Home url should be the default");
 });
+
+add_task(function* test_local() {
+  let defaultHomePage = Preferences.get("browser.startup.homepage");
+
+  let ext1 = ExtensionTestUtils.loadExtension({
+    manifest: {"chrome_settings_overrides": {"homepage": "home.html"}},
+    useAddonManager: "temporary",
+  });
+
+  let prefPromise = promisePrefChangeObserved("browser.startup.homepage");
+  yield ext1.startup();
+  yield prefPromise;
+
+  let homepage = Preferences.get("browser.startup.homepage");
+  ok((homepage.startsWith("moz-extension") && homepage.endsWith("home.html")),
+     "Home url should be relative to extension.");
+
+  yield ext1.unload();
+});