Bug 1962312 - Make about:home load about:blank on GeckoView r=nalexander,gl,mconley

Today, if we try to load `about:home`, we get a load error because it is
not a valid about page.

For an embedder to have `about:home` in the back-forward history, we
need to allow the request to load successfully. That means that we need
to let it, at minimum, do nothing - for this, we just load
`about:blank`.

Should this be behind a pref or GeckoRuntimeSetting?
Our only prior art is `about:config` which controls Gecko functionality.
This is a feature that has valid use cases for controlling behind a
pref, whereas `about:home` does nothing similar to `about:blank` which
does not have a pref.

Differential Revision: https://phabricator.services.mozilla.com/D246543
This commit is contained in:
Jonathan Almeida
2025-04-24 22:37:33 +00:00
parent 65889d32d2
commit a41c51ac84
2 changed files with 8 additions and 0 deletions

View File

@@ -117,6 +117,12 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::HIDE_FROM_ABOUTABOUT | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
#ifdef MOZ_WIDGET_ANDROID
{"home", "about:blank",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD},
#endif
{"httpsonlyerror", "chrome://global/content/httpsonlyerror/errorpage.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |

View File

@@ -41,6 +41,8 @@ if defined('MOZ_CRASHREPORTER'):
about_pages.append('crashes')
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'android':
about_pages.append('profiles')
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
about_pages.append('home')
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'windows':
about_pages.append('third-party')
about_pages.append('windows-messages')