mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Fix bug where search bar in about:home does nothing
This commit is contained in:
parent
bd5b144112
commit
6dfeba05d1
7 changed files with 104 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue