diff -urN firefox-128.0-orig/browser/app/profile/firefox.js firefox-128.0/browser/app/profile/firefox.js
--- firefox-128.0-orig/browser/app/profile/firefox.js	2024-07-05 02:04:12 +0900
+++ firefox-128.0/browser/app/profile/firefox.js	2024-07-09 17:58:37 +0900
@@ -538,6 +538,10 @@
 // is longer than this.
 pref("browser.urlbar.maxCharsForSearchSuggestions", 100);
 
+// Restrictions to current suggestions can also be applied (intersection).
+// Typed suggestion works only if history is set to true.
+pref("browser.urlbar.suggest.history.onlyTyped",    false);
+
 pref("browser.urlbar.trimURLs", true);
 
 #ifdef NIGHTLY_BUILD
diff -urN firefox-128.0-orig/browser/components/urlbar/UrlbarPrefs.sys.mjs firefox-128.0/browser/components/urlbar/UrlbarPrefs.sys.mjs
--- firefox-128.0-orig/browser/components/urlbar/UrlbarPrefs.sys.mjs	2024-07-05 02:04:12 +0900
+++ firefox-128.0/browser/components/urlbar/UrlbarPrefs.sys.mjs	2024-07-09 17:58:37 +0900
@@ -386,6 +386,11 @@
   // mdn suggestions are turned on.
   ["suggest.mdn", true],
 
+  // Results will include the user's history when this is true, but only those
+  // URLs with the "typed" flag (which includes but isn't limited to URLs the
+  // user has typed in the urlbar).
+  ["suggest.history.onlyTyped", false],
+
   // Whether results will include switch-to-tab results.
   ["suggest.openpage", true],
 
@@ -1412,6 +1417,9 @@
       case "showSearchSuggestionsFirst":
         this.#resultGroups = null;
         return;
+      case "suggest.history":
+        this._map.delete("suggest.history.onlyTyped");
+        break;
     }
 
     if (pref.startsWith("suggest.")) {
@@ -1520,14 +1528,17 @@
    */
   _getPrefValue(pref) {
     switch (pref) {
+      case "suggest.history.onlyTyped": {
+        // If history is not set, onlyTyped value should be ignored.
+        return this.get("suggest.history") && this._readPref(pref);
+      }
       case "defaultBehavior": {
         let val = 0;
-        for (let type of Object.keys(SUGGEST_PREF_TO_BEHAVIOR)) {
-          let behavior = `BEHAVIOR_${SUGGEST_PREF_TO_BEHAVIOR[
-            type
-          ].toUpperCase()}`;
-          val |=
-            this.get("suggest." + type) && Ci.mozIPlacesAutoComplete[behavior];
+        for (let type of [...Object.keys(SUGGEST_PREF_TO_BEHAVIOR), "history.onlyTyped"]) {
+          let behavior = type == "history.onlyTyped" ?
+            "TYPED" : SUGGEST_PREF_TO_BEHAVIOR[type].toUpperCase();
+          val |= this.get("suggest." + type) &&
+                 Ci.mozIPlacesAutoComplete["BEHAVIOR_" + behavior];
         }
         return val;
       }
diff -urN firefox-128.0-orig/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs firefox-128.0/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
--- firefox-128.0-orig/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs	2024-07-05 02:04:12 +0900
+++ firefox-128.0/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs	2024-07-09 17:58:37 +0900
@@ -579,6 +579,11 @@
   setBehavior(type) {
     type = type.toUpperCase();
     this._behavior |= Ci.mozIPlacesAutoComplete["BEHAVIOR_" + type];
+
+    // Setting the "typed" behavior should also set the "history" behavior.
+    if (type == "TYPED") {
+      this.setBehavior("history");
+    }
   },
 
   /**
@@ -1245,6 +1250,9 @@
         conditions.push("tags NOTNULL");
       }
     }
+    if (this.hasBehavior("typed")) {
+      conditions.push("h.typed = 1");
+    }
 
     return defaultQuery(conditions.join(" AND "));
   },
@@ -1256,7 +1264,8 @@
     // bookmarks are disabled, it defaults to open pages.
     let val = Ci.mozIPlacesAutoComplete.BEHAVIOR_RESTRICT;
     if (lazy.UrlbarPrefs.get("suggest.history")) {
-      val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_HISTORY;
+      val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_HISTORY |
+             Ci.mozIPlacesAutoComplete.BEHAVIOR_TYPED;
     } else if (lazy.UrlbarPrefs.get("suggest.bookmark")) {
       val |= Ci.mozIPlacesAutoComplete.BEHAVIOR_BOOKMARK;
     } else {
diff -urN firefox-128.0-orig/toolkit/components/places/SQLFunctions.cpp firefox-128.0/toolkit/components/places/SQLFunctions.cpp
--- firefox-128.0-orig/toolkit/components/places/SQLFunctions.cpp	2024-07-05 02:04:30 +0900
+++ firefox-128.0/toolkit/components/places/SQLFunctions.cpp	2024-07-09 17:58:37 +0900
@@ -455,8 +455,6 @@
   }
 
   int32_t visitCount = aArguments->AsInt32(kArgIndexVisitCount);
-  // Filtering on typed is no more used by Firefox, it is still being used by
-  // comm-central clients.
   bool typed = aArguments->AsInt32(kArgIndexTyped) != 0;
   bool bookmark = aArguments->AsInt32(kArgIndexBookmark) != 0;
   nsDependentCString tags = getSharedUTF8String(aArguments, kArgIndexTags);
diff -urN firefox-128.0-orig/toolkit/components/places/mozIPlacesAutoComplete.idl firefox-128.0/toolkit/components/places/mozIPlacesAutoComplete.idl
--- firefox-128.0-orig/toolkit/components/places/mozIPlacesAutoComplete.idl	2024-07-05 02:04:30 +0900
+++ firefox-128.0/toolkit/components/places/mozIPlacesAutoComplete.idl	2024-07-09 17:58:37 +0900
@@ -85,7 +85,6 @@
 
   /**
    * Search for typed pages.
-   * No more supported by Firefox, it is still being used by comm-central clients.
    */
   const long BEHAVIOR_TYPED = 1 << 5;
 
