Bug 1408044 - stop using/overriding about: in Fennec and use about:fennec/firefox instead, r?nalexander draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 14 Nov 2017 23:41:37 +0000
changeset 700582 8ef3506e2f667b789800116c4f88f5bc521ff83b
parent 700581 a7100bb6a8d402b1f7f9f7ed018b9d7f4a8c74c4
child 700583 8b97a4aafe3e817f34aa6f1198bb8e3d8a2c35a0
push id89894
push usergijskruitbosch@gmail.com
push dateMon, 20 Nov 2017 13:11:38 +0000
reviewersnalexander
bugs1408044
milestone59.0a1
Bug 1408044 - stop using/overriding about: in Fennec and use about:fennec/firefox instead, r?nalexander MozReview-Commit-ID: 3LQjMJZOuqc
mobile/android/app/src/main/res/xml/preferences_vendor.xml
mobile/android/app/src/test/java/org/mozilla/gecko/icons/TestIconsHelper.java
mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestAboutPagesPreparer.java
mobile/android/base/java/org/mozilla/gecko/AboutPages.java
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/chrome/content/browser.js
mobile/android/chrome/jar.mn
mobile/android/components/AboutRedirector.js
mobile/android/tests/browser/chrome/test_identity_mode.html
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAboutPage.java
mobile/android/themes/core/about.css
--- a/mobile/android/app/src/main/res/xml/preferences_vendor.xml
+++ b/mobile/android/app/src/main/res/xml/preferences_vendor.xml
@@ -6,17 +6,17 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                   xmlns:gecko="http://schemas.android.com/apk/res-auto"
                   android:title="@string/pref_category_vendor"
                   android:enabled="false">
 
     <org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.about.link"
                                                   android:title="@string/pref_about_firefox"
                                                   android:persistent="false"
-                                                  url="about:" />
+                                                  url="about:firefox" />
 
     <org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.faq.link"
                                                   android:title="@string/pref_vendor_faqs"
                                                   android:persistent="false"/>
 
     <org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.feedback.link"
                                                   android:title="@string/pref_vendor_feedback"
                                                   android:persistent="false"/>
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/icons/TestIconsHelper.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/icons/TestIconsHelper.java
@@ -28,18 +28,18 @@ public class TestIconsHelper {
 
         // Special about: URLs.
 
         Assert.assertEquals(
                 "about:home",
                 IconsHelper.guessDefaultFaviconURL("about:home"));
 
         Assert.assertEquals(
-                "about:",
-                IconsHelper.guessDefaultFaviconURL("about:"));
+                "about:firefox",
+                IconsHelper.guessDefaultFaviconURL("about:firefox"));
 
         Assert.assertEquals(
                 "about:addons",
                 IconsHelper.guessDefaultFaviconURL("about:addons"));
 
         // Non http(s) URLS
 
         final String jarUrl = GeckoJarReader.getJarURL(RuntimeEnvironment.application, "chrome/chrome/content/branding/favicon64.png");
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestAboutPagesPreparer.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestAboutPagesPreparer.java
@@ -15,18 +15,17 @@ import org.robolectric.RuntimeEnvironmen
 public class TestAboutPagesPreparer {
     private static final String[] ABOUT_PAGES = {
             AboutPages.ACCOUNTS,
             AboutPages.ADDONS,
             AboutPages.CONFIG,
             AboutPages.DOWNLOADS,
             AboutPages.FIREFOX,
             AboutPages.HEALTHREPORT,
-            AboutPages.HOME,
-            AboutPages.UPDATER
+            AboutPages.HOME
     };
 
     @Test
     public void testPreparerAddsUrlsForAllAboutPages() {
         final Preparer preparer = new AboutPagesPreparer();
 
         for (String url : ABOUT_PAGES) {
             final IconRequest request = Icons.with(RuntimeEnvironment.application)
--- a/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
@@ -21,17 +21,16 @@ public class AboutPages {
     public static final String CONFIG          = "about:config";
     public static final String DOWNLOADS       = "about:downloads";
     public static final String FIREFOX         = "about:firefox";
     public static final String HEALTHREPORT    = "about:healthreport";
     public static final String HOME            = "about:home";
     public static final String LOGINS          = "about:logins";
     public static final String PRIVATEBROWSING = "about:privatebrowsing";
     public static final String READER          = "about:reader";
-    public static final String UPDATER         = "about:";
 
     public static final String URL_FILTER = "about:%";
 
     public static final String PANEL_PARAM = "panel";
 
     public static final boolean isAboutPage(final String url) {
         return url != null && url.startsWith("about:");
     }
@@ -78,18 +77,17 @@ public class AboutPages {
 
     public static final List<String> DEFAULT_ICON_PAGES = Collections.unmodifiableList(Arrays.asList(
             HOME,
             ACCOUNTS,
             ADDONS,
             CONFIG,
             DOWNLOADS,
             FIREFOX,
-            HEALTHREPORT,
-            UPDATER
+            HEALTHREPORT
     ));
 
     public static boolean isBuiltinIconPage(final String url) {
         if (url == null ||
             !url.startsWith("about:")) {
             return false;
         }
 
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -2136,29 +2136,29 @@ public class BrowserApp extends GeckoApp
                 break;
 
             case "Updater:Launch":
                 /**
                  * Launch UI that lets the user update Firefox.
                  *
                  * This depends on the current channel: Release and Beta both direct to
                  * the Google Play Store. If updating is enabled, Aurora, Nightly, and
-                 * custom builds open about:, which provides an update interface.
+                 * custom builds open about:firefox, which provides an update interface.
                  *
                  * If updating is not enabled, this simply logs an error.
                  */
                 if (AppConstants.RELEASE_OR_BETA) {
                     Intent intent = new Intent(Intent.ACTION_VIEW);
                     intent.setData(Uri.parse("market://details?id=" + getPackageName()));
                     startActivity(intent);
                     break;
                 }
 
                 if (AppConstants.MOZ_UPDATER) {
-                    Tabs.getInstance().loadUrlInTab(AboutPages.UPDATER);
+                    Tabs.getInstance().loadUrlInTab(AboutPages.FIREFOX);
                     break;
                 }
 
                 Log.w(LOGTAG, "No candidate updater found; ignoring launch request.");
                 break;
 
             case "Download:AndroidDownloadManager":
                 // Downloading via Android's download manager
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -5533,18 +5533,17 @@ var IdentityHandler = {
     if (aState & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) {
       return this.IDENTITY_MODE_VERIFIED;
     }
 
     if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE) {
       return this.IDENTITY_MODE_IDENTIFIED;
     }
 
-    // We also allow "about:" by allowing the selector to be empty (i.e. '(|.....|...|...)'
-    let whitelist = /^about:($|about|accounts|addons|buildconfig|cache|config|crashes|devices|downloads|fennec|firefox|feedback|healthreport|home|license|logins|logo|memory|mozilla|networking|privatebrowsing|rights|serviceworkers|support|telemetry|webrtc)($|\?)/i;
+    let whitelist = /^about:(about|accounts|addons|buildconfig|cache|config|crashes|devices|downloads|fennec|firefox|feedback|healthreport|home|license|logins|logo|memory|mozilla|networking|privatebrowsing|rights|serviceworkers|support|telemetry|webrtc)($|\?)/i;
     if (uri.schemeIs("about") && whitelist.test(uri.spec)) {
         return this.IDENTITY_MODE_CHROMEUI;
     }
 
     return this.IDENTITY_MODE_UNKNOWN;
   },
 
   getMixedDisplayMode: function getMixedDisplayMode(aState) {
--- a/mobile/android/chrome/jar.mn
+++ b/mobile/android/chrome/jar.mn
@@ -58,17 +58,16 @@ chrome.jar:
 
 % content branding %content/branding/
 
 % override chrome://global/content/config.xul chrome://browser/content/config.xhtml
 % override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
 % override chrome://mozapps/content/extensions/extensions.xul chrome://browser/content/aboutAddons.xhtml
 
 # L10n resource overrides.
-% override chrome://global/locale/about.dtd chrome://browser/locale/overrides/about.dtd
 % override chrome://global/locale/aboutAbout.dtd chrome://browser/locale/overrides/aboutAbout.dtd
 % override chrome://global/locale/aboutReader.properties chrome://browser/locale/overrides/aboutReader.properties
 % override chrome://global/locale/aboutRights.dtd chrome://browser/locale/overrides/aboutRights.dtd
 % override chrome://global/locale/charsetMenu.properties chrome://browser/locale/overrides/charsetMenu.properties
 % override chrome://global/locale/commonDialogs.properties chrome://browser/locale/overrides/commonDialogs.properties
 % override chrome://global/locale/intl.properties chrome://browser/locale/overrides/intl.properties
 % override chrome://global/locale/intl.css chrome://browser/locale/overrides/intl.css
 % override chrome://global/locale/search/search.properties chrome://browser/locale/overrides/search/search.properties
--- a/mobile/android/components/AboutRedirector.js
+++ b/mobile/android/components/AboutRedirector.js
@@ -4,31 +4,25 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var modules = {
-  // about:
-  "": {
-    uri: "chrome://browser/content/about.xhtml",
-    privileged: true
-  },
-
-  // about:fennec and about:firefox are aliases for about:,
-  // but hidden from about:about
   fennec: {
     uri: "chrome://browser/content/about.xhtml",
     privileged: true,
     hide: true
   },
+
+  // about:firefox is an alias for about:fennec, but not hidden from about:about
   get firefox() {
-    return this.fennec;
+    return Object.assign({}, this.fennec, {hide: false});
   },
 
   // about:blank has some bad loading behavior we can avoid, if we use an alias
   empty: {
     uri: "about:blank",
     privileged: false,
     hide: true
   },
--- a/mobile/android/tests/browser/chrome/test_identity_mode.html
+++ b/mobile/android/tests/browser/chrome/test_identity_mode.html
@@ -17,18 +17,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   Cu.import("resource://gre/modules/Services.jsm");
 
   let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
   let IdentityHandler = chromeWin.IdentityHandler;
 
-  ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
-     "'about:' is a verified internal page");
+  ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:firefox")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
+     "'about:firefox' is a verified internal page");
   ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:config")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
      "'about:config' is a verified internal page");
   ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
      "'about:accounts is a verified internal page");
   ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:addonss")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
      "'about:addonss is not a verified internal page");
   ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accountss")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
      "'about:accountss is not a verified internal page");
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAboutPage.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAboutPage.java
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.tests;
 
 import org.mozilla.gecko.Actions;
 
-/* Tests related to the about: page:
- *  - check that about: loads from the URL bar
- *  - check that about: loads from Settings/About...
+/* Tests related to the about:firefox page:
+ *  - check that about:firefox loads from the URL bar
+ *  - check that about:firefox loads from Settings/About...
  */
 public class testAboutPage extends PixelTest {
 
     public void testAboutPage() {
         blockForGeckoReady();
 
-        // Load the about: page and verify its title.
-        String url = mStringHelper.ABOUT_SCHEME;
+        // Load the about:firefox page and verify its title.
+        String url = mStringHelper.ABOUT_SCHEME + "firefox";
         loadAndPaint(url);
 
         verifyUrlInContentDescription(url);
 
-        // Open a new page to remove the about: page from the current tab.
+        // Open a new page to remove the about:firefox page from the current tab.
         url = getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL);
         loadUrlAndWait(url);
 
         // At this point the page title should have been set.
         verifyUrlInContentDescription(url);
 
         // Set up listeners to catch the page load we're about to do.
         Actions.EventExpecter tabEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Tab:Added");
@@ -36,12 +36,12 @@ public class testAboutPage extends Pixel
 
         // Wait for the new tab and page to load
         tabEventExpecter.blockForEvent();
         contentEventExpecter.blockForEvent();
 
         tabEventExpecter.unregisterListener();
         contentEventExpecter.unregisterListener();
 
-        // Make sure the about: page was loaded.
-        verifyUrlInContentDescription(mStringHelper.ABOUT_SCHEME);
+        // Make sure the about:firefox page was loaded.
+        verifyUrlInContentDescription(mStringHelper.ABOUT_SCHEME + "firefox");
     }
 }
--- a/mobile/android/themes/core/about.css
+++ b/mobile/android/themes/core/about.css
@@ -21,30 +21,18 @@ body {
   padding-inline-start: 30px;
   background: white;
 }
 
 .aboutPageWideContainer {
   max-width: 80%;
 }
 
-#aboutLogoContainer {
-  border: 1px solid lightgray;
-  width: 300px;
-  margin-bottom: 2em;
-}
-
 img {
   border: 0;
 }
 
-#version {
-  font-weight: bold;
-  color: #909090;
-  margin: -24px 0 9px 17px;
-}
-
 ul {
   margin: 0;
   margin-inline-start: 1.5em;
   padding: 0;
   list-style: square;
 }