Fix bug where search bar in about:home does nothing

This commit is contained in:
ownedbywuigi 2026-04-01 16:33:21 +01:00
commit 6dfeba05d1
7 changed files with 104 additions and 9 deletions

View file

@ -81,6 +81,7 @@ var AboutHome = {
"AboutHome:Addons",
"AboutHome:Sync",
"AboutHome:Settings",
"AboutHome:Search",
"AboutHome:RequestUpdate",
"AboutHome:MaybeShowAutoMigrationUndoNotification",
],
@ -129,6 +130,31 @@ var AboutHome = {
window.openPreferences();
break;
case "AboutHome:Search": {
let data = aMessage.data || {};
let searchString = (data.searchString || "").trim();
if (!searchString) {
break;
}
let engine = Services.search.defaultEngine;
if (!engine) {
break;
}
let submission = engine.getSubmission(searchString, "", "homepage");
if (!submission) {
break;
}
aMessage.target.loadURIWithFlags(submission.uri.spec,
Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
null,
null,
submission.postData);
break;
}
case "AboutHome:RequestUpdate":
this.sendAboutHomeData(aMessage.target);
break;