Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
74c1e53
Bug 2013322 - Remove (activity as HomeActivity) casts in TopSiteContr…
azinovyev Feb 6, 2026
2ef7462
Bug 1994918 part 2 - improve windows message debug output for WM_NCHI…
gregstoll Feb 6, 2026
c5868a9
Bug 2000718 - Trigger in-panel bandwidth limit warning messages at 75…
Feb 6, 2026
136b2cc
Bug 2010422 - Add loader for chat assistant r=ai-frontend-reviewers,M…
gcardieri Feb 6, 2026
40d36ba
Bug 2010200 - Add default `distribution.ini` for official Linux build…
ahochheiden Feb 6, 2026
214a01a
Bug 2014616: Always create the Profile Groups folder in case it is mi…
Mossop Feb 6, 2026
1a313f1
Bug 2015047 - Fix disabled UI tests that leave the Tabs Tray/Tab mana…
AndiAJ Feb 6, 2026
a595f56
Bug 2015073 - don't submit a repo-update patch to phab when running f…
jcristau Feb 6, 2026
5183576
Revert "Bug 2010422 - Add loader for chat assistant r=ai-frontend-rev…
Feb 6, 2026
a3689c3
Revert "Bug 2014616: Always create the Profile Groups folder in case …
Feb 6, 2026
93dfeee
Bug 2013011 - Check implicit anchor validity. r=layout-anchor-positio…
emilio Feb 6, 2026
c77441e
Bug 1986639 - Invalidate elements with styles that reference custom a…
dcrescalante Feb 6, 2026
c4a43cb
Bug 2010062 - set message length threshold for memory generation from…
chidamnat Feb 6, 2026
8522c43
Bug 2014320 - Memories generation to handle bigger inputs r=cdipersio…
chidamnat Feb 6, 2026
98c974b
Bug 2014279 - Add new tool to return all saved memories to the assist…
cdipersio-moz Feb 6, 2026
56c5512
Bug 2010597 - Add unified widget telemetry metrics. r=home-newtab-rev…
maxxcrawford Feb 6, 2026
14f9862
Bug 2012824 - Update widget telemetry events to pass the correct valu…
maxxcrawford Feb 6, 2026
3010d7e
Bug 2012838 - Fix data-eventSource attributes in ContentSection to us…
maxxcrawford Feb 6, 2026
c9ba075
Bug 2013133 - Add unified widget telemetry for Lists widget. r=home-n…
maxxcrawford Feb 6, 2026
5d0de78
Bug 2013134 - Add unified widget telemetry for FocusTimer widget. r=h…
maxxcrawford Feb 6, 2026
d200301
Bug 2013136 - Migrate Weather widget context menu from LinkMenu to pa…
maxxcrawford Feb 6, 2026
04fd6b1
Bug 2013138 - Add unified widget telemetry to Weather widget. r=home-…
maxxcrawford Feb 6, 2026
f992dc6
Bug 2012821 - Add unified telemetry for widget container actions. r=h…
maxxcrawford Feb 6, 2026
31804e1
Bug 2011112 - Add telemetry for Weather Forecast widget. r=home-newta…
maxxcrawford Feb 6, 2026
e98e47c
Bug 2013966 - use the page's JS context rather than an isolated sandb…
wisniewskit Feb 6, 2026
6a1e134
Bug 1950282 - update our webcompat intervention for f1tv.formula1.com…
wisniewskit Feb 6, 2026
04acfe2
Bug 2013705 - actually await SmartBlock shims RemoteSettings updates …
wisniewskit Feb 6, 2026
f1372fd
Bug 2000262 - Add dedicated Docker image for partials-zucchini genera…
hneiva Feb 6, 2026
d416d4c
Bug 2000262 - Major refactor zucchini partials generator r=releng-rev…
hneiva Feb 6, 2026
8061d4f
Bug 2012546 - Fix zucchini partials patch manifest entries r=yjuglare…
hneiva Feb 6, 2026
30c991c
Bug 2003084 - update toolbar tokens to use underlying design tokens r…
jonoliver Feb 6, 2026
8473191
Bug 1995062 - Part 1: render backup-settings via config r=fluent-revi…
hannajones Feb 6, 2026
92f1deb
Bug 1995062 - Part 2: convert backup-settings to match new settings U…
hannajones Feb 6, 2026
a8fdc42
Bug 1995062 - Part 3: fix backup-settings tests r=cdupuis,akulyk
hannajones Feb 6, 2026
27b3c49
Bug 1995062 - Part 4: add tests and stories for new component functio…
hannajones Feb 6, 2026
b0204f4
Revert "Bug 1986639 - Invalidate elements with styles that reference …
Feb 6, 2026
922e545
Revert "Bug 2014279 - Add new tool to return all saved memories to th…
Feb 6, 2026
2a69e07
No Bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBU…
Feb 6, 2026
7403c5a
No Bug - Bumping Mobile l10n changesets r=release a=l10n-bump DONTBUI…
Feb 6, 2026
c949f90
Revert "Bug 2011162 - Bump required `tox` version to `3.28.0` r=ahal"…
Feb 6, 2026
d6b3d56
Revert "Bug 1995062 - Part 4: add tests and stories for new component…
Feb 6, 2026
7016f0d
Revert "Bug 2010200 - Add default `distribution.ini` for official Lin…
Feb 6, 2026
bdf17c9
No bug - Update the Pocket Guide to reflect the end of the Nightly so…
rvandermeulen Feb 6, 2026
18a22af
Bug 2012971: Increase inlining entry threshold to 95 r=spidermonkey-r…
iainireland Feb 6, 2026
b31cd1b
Bug 2012519 - Replace usage of newtab-toast-dismiss-button r=home-new…
Feb 6, 2026
2a6118b
Bug 2014920 - Add new GeckoView page extraction API to the android-co…
segunfamisa Feb 6, 2026
67d155f
Bug 2009544 — replace generic connection error message bar with statu…
kpatenio Feb 6, 2026
92b04d9
Bug 2009548 — add internet connection error state UI. r=ip-protection…
kpatenio Feb 6, 2026
c8b56b7
Bug 2014043 - Additional WebGPU CTS expectation updates r=webgpu-revi…
andyleiserson Feb 6, 2026
7df3bbd
Bug 2013939 - Fix chat output not readable in Smart Window dark mode …
yjamora Feb 6, 2026
47206e7
Bug 2014612 - generate-test-certs: search more of the tree for input …
mozkeeler Feb 6, 2026
a1a330f
Bug 2014612 - regenerate expired qwac test roots r=jschanck
mozkeeler Feb 6, 2026
d019676
Bug 2014549 - Refactor Optional<nsAString> to Maybe<nsAutoString> HTM…
keithamus Feb 6, 2026
35d9aa0
Bug 2013896 - Add a test for this bug. r=dshin,layout-anchor-position…
emilio Feb 6, 2026
222f8d1
Bug 2014986 - Improve prev sibling computation for flex / grid contai…
emilio Feb 6, 2026
7e39b63
Bug 2010422 - Add loader for chat assistant r=ai-frontend-reviewers,M…
gcardieri Feb 6, 2026
1574c96
Bug 2010759 - add support for static elements to moz-box-group r=desk…
hannajones Feb 6, 2026
db24603
Bug 2004059 - Add thumbnail support for wallpaper previews r=home-new…
maxxcrawford Feb 6, 2026
b82fc44
Bug 2015029 - make xpcshell and mochitest output group_result status=…
fqueze Feb 6, 2026
944f0ab
Bug 2013896 - Remove trailing whitespace to fix wptlint.
emilio Feb 6, 2026
a5d610c
Bug 1986639 - Invalidate elements with styles that reference custom a…
dcrescalante Feb 6, 2026
744ac0e
Bug 2013961 - Part 0: Add a Relay integration class r=gmalekpour,andr…
jonalmeida Feb 6, 2026
af55065
Bug 2013961 - Part 1: Update engine on relay eligibility changes r=gm…
jonalmeida Feb 6, 2026
42c3a56
Bug 2015149 - Make DummyAttributeProvider private. r=firefox-style-sy…
Loirooriol Feb 6, 2026
74cdb92
Bug 1996952 - Bake the M4 experiment Merino OHTTP endpoints into Nigh…
0c0w3 Feb 6, 2026
19d9c15
Bug 1998009 - Make online Suggest available on Nightly for eligible u…
0c0w3 Feb 6, 2026
7edf28d
Bug 1707584 - part1 : implement :playing and :paused pseudo classes. …
alastor0325 Feb 6, 2026
90eb82c
Bug 1707584 - part2 : implement :seeking pseudo class. r=media-playba…
alastor0325 Feb 6, 2026
b25ca8c
Bug 1707584 - part3 : implement :buffering and :stalled pseudo classe…
alastor0325 Feb 6, 2026
4c0c504
Bug 1707584 - part4 : implement :muted pseudo class. r=media-playback…
alastor0325 Feb 6, 2026
b6a6bba
Bug 1707584 - part5 : implement :volume-locked pseudo class. r=firefo…
alastor0325 Feb 6, 2026
b418243
Bug 1707584 - part6 : defer pausing video element during the style re…
alastor0325 Feb 6, 2026
f5c1597
Bug 2014822 - Bump chat prompt to v2 for run_search tool support r=bj…
azg-mozilla Feb 6, 2026
28aba4f
Bug 2009492 - Add IP Protection bandwidth reset CFR strings to ipProt…
Feb 6, 2026
f9508ba
No Bug - Import translations from https://github.com/mozilla-l10n/and…
Feb 7, 2026
7b05f4e
Bug 2009463 - The Mozilla VPN button in the Manage Account menu shoul…
Feb 6, 2026
0d4257e
Bug 2013412 - Close sidebar when entering immersive view in AI Window…
Feb 6, 2026
12e053d
Bug 2014737 - Add Window Switcher Box Shadow Styling r=desktop-theme-…
unifolia Feb 6, 2026
670eb2a
Bug 2013562: Enter correct realm before resolving same-thread waitAsy…
iainireland Feb 7, 2026
47d7324
Bug 2010200 - Add default `distribution.ini` for official Linux build…
ahochheiden Feb 7, 2026
bab4a2c
Bug 2013351: Don't crash trying to collapse :has() invalidations in @…
dshin-moz Feb 7, 2026
fca3104
Bug 2012651: Fix caret coordinates at the start of a paragraph preced…
jcsteh Feb 7, 2026
55fad69
No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suf…
Feb 7, 2026
d2d859b
Revert "Bug 2013562: Enter correct realm before resolving same-thread…
Feb 7, 2026
79f51bf
Revert "Bug 2014822 - Bump chat prompt to v2 for run_search tool supp…
Feb 7, 2026
7770825
Bug 1842988 - Remove dom.keyboardevent.init_key_event.enabled pref r=…
mathewhodson Feb 7, 2026
a14cdfa
Bug 2012536 - Implement tab switching for smart window sidebar state …
s9tpepper Feb 7, 2026
b1264e3
Revert "Bug 2012536 - Implement tab switching for smart window sideba…
Feb 7, 2026
f48aefa
Bug 2012794 - Check for errors from FT_Set_Char_Size. r=jfkthame
lsalzman Feb 7, 2026
66b789a
Bug 2014822 - Bump chat prompt to v2 for run_search tool support r=bj…
azg-mozilla Feb 7, 2026
e148de5
No Bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBU…
Feb 7, 2026
c4d5458
No Bug - Bumping Mobile l10n changesets r=release a=l10n-bump DONTBUI…
Feb 7, 2026
a46c0f8
Revert "Bug 2014612 - disable browser_trust_panel_security_view.js, t…
CosminSabou Feb 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 18 additions & 4 deletions accessible/base/TextLeafRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,18 @@ static bool IsCaretValid(TextLeafPoint aPoint) {
return focus->State() & states::EDITABLE;
}

static bool IsStartOfFocusedEditor(TextLeafPoint& aPoint) {
if (aPoint.mOffset != 0) {
return false;
}
Accessible* focus = FocusMgr() ? FocusMgr()->FocusedAccessible() : nullptr;
if (!focus || !(focus->State() & states::EDITABLE)) {
// There isn't a focused editor.
return false;
}
return aPoint == TextLeafPoint(focus, 0);
}

/*** TextLeafPoint ***/

TextLeafPoint::TextLeafPoint(Accessible* aAcc, int32_t aOffset) {
Expand Down Expand Up @@ -1149,17 +1161,19 @@ TextLeafPoint TextLeafPoint::GetCaret(Accessible* aAcc) {
// node.
// 3. The caret is somewhere other than the start of a line and the user
// presses down or up arrow to move by line.
// 4. The user focuses a contentEditable and the caret is positioned on
// the first character.
if (point.mOffset <
static_cast<int32_t>(nsAccUtils::TextLength(point.mAcc))) {
// The caret is at the end of a line if the point is at the start of a
// line but not at the start of a paragraph.
// line but not the start of a focused editor.
point.mIsEndOfLineInsertionPoint =
point.FindPrevLineStartSameLocalAcc(/* aIncludeOrigin */ true) ==
point &&
!point.IsParagraphStart();
!IsStartOfFocusedEditor(point);
} else {
// This is the end of a node. CaretAssociationHint::Before is only used
// at the end of a node if the caret is at the end of a line.
// CaretAssociationHint::Before is only used at the end of a node if the
// caret is both at the end of a node and at the end of a line.
point.mIsEndOfLineInsertionPoint = true;
}
}
Expand Down
49 changes: 46 additions & 3 deletions accessible/tests/browser/bounds/browser_caret_rect.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ function testCaretRect(
atLineEnd = false,
isVertical = false
) {
const acc = findAccessibleChildByID(docAcc, id, [nsIAccessibleText]);
const acc = findAccessibleChildByID(docAcc, id, [
nsIAccessibleText,
nsIAccessibleHyperText,
]);
is(acc.caretOffset, offset, `Caret at offset ${offset}`);
const atEnd = offset == acc.characterCount;
const empty = offset == 0 && atEnd;
Expand All @@ -102,8 +105,11 @@ function testCaretRect(

const [caretX, caretY, caretW, caretH] = getCaretRect(docAcc, id);

if (!empty) {
// In case of an empty input `getRangeExtents()` will return the full accessible bounds.
// In case of an empty input `getRangeExtents()` will return the full accessible bounds.
// When called on an embedded object, `getRangeExtents()` will return the
// bounds for the content inside it, so it isn't a collapsed range and thus it
// won't match the caret.
if (!empty && acc.getLinkIndexAtOffset(offset) == -1) {
let [currRangeX, currRangeY, currRangeW] = getCollapsedRangeExtents(
acc,
acc.caretOffset
Expand Down Expand Up @@ -555,3 +561,40 @@ addAccessibleTask(
}
}
);

/**
* Test a contentEditable with a paragraph containing a line break.
*/
addAccessibleTask(
`
<style>
@font-face {
font-family: Ahem;
src: url(${CURRENT_CONTENT_DIR}e10s/fonts/Ahem.sjs);
}
#editable {
font: 10px/10px Ahem;
}
</style>
<div id="editable" contenteditable>a<p><br></p></div>
`,
async function testEditablePBr(browser, docAcc) {
const editable = findAccessibleChildByID(docAcc, "editable", [
nsIAccessibleText,
]);
const fetchedBounds = await fetchCollapsedRangeBounds(docAcc, editable);

info("Focusing editable");
let moved = waitForEvent(EVENT_FOCUS, editable);
editable.takeFocus();
await moved;
testCaretRect(docAcc, "editable", 0, fetchedBounds);

info("Pressing ArrowRight");
moved = waitForEvent(EVENT_TEXT_CARET_MOVED);
EventUtils.synthesizeKey("KEY_ArrowRight");
await moved;
testCaretRect(docAcc, "editable", 1, fetchedBounds, true);
},
{ chrome: true, topLevel: true }
);
60 changes: 59 additions & 1 deletion accessible/tests/browser/text/browser_text_caret.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ addAccessibleTask(
cols="6">ab cd e</textarea>
<textarea id="empty"></textarea>
<div id="contentEditable" contenteditable>a<span>b</span></div>
<div id="editableWithTextThenP" contenteditable>a<p>b</p></div>
<div id="editableWithTextAndLink" contenteditable>a<a href="#">b</a>c</div>
`,
async function (browser, docAcc) {
async function testRetrieval(browser, docAcc) {
const textarea = findAccessibleChildByID(docAcc, "textarea", [
nsIAccessibleText,
]);
Expand Down Expand Up @@ -513,6 +515,62 @@ addAccessibleTask(
kOk,
kOk
);

const editableWithTextThenP = findAccessibleChildByID(
docAcc,
"editableWithTextThenP",
[nsIAccessibleText]
);
info("Focusing editableWithTextThenP");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, editableWithTextThenP);
editableWithTextThenP.takeFocus();
evt = await caretMoved;
is(
editableWithTextThenP.caretOffset,
0,
"Initial caret offset in editableWithTextThenP is 0"
);
evt.QueryInterface(nsIAccessibleCaretMoveEvent);
ok(!evt.isAtEndOfLine, "Caret is not at end of line");
info("Pressing ArrowRight");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, editableWithTextThenP);
EventUtils.synthesizeKey("KEY_ArrowRight");
evt = await caretMoved;
is(
editableWithTextThenP.caretOffset,
1,
"Caret offset is 1 after ArrowRight"
);
evt.QueryInterface(nsIAccessibleCaretMoveEvent);
ok(evt.isAtEndOfLine, "Caret is at end of line");

const editableWithTextAndLink = findAccessibleChildByID(
docAcc,
"editableWithTextAndLink",
[nsIAccessibleText]
);
info("Focusing editableWithTextAndLink");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, editableWithTextAndLink);
editableWithTextAndLink.takeFocus();
evt = await caretMoved;
is(
editableWithTextAndLink.caretOffset,
0,
"Initial caret offset in editableWithTextAndLink is 0"
);
evt.QueryInterface(nsIAccessibleCaretMoveEvent);
ok(!evt.isAtEndOfLine, "Caret is not at end of line");
info("Pressing ArrowRight");
caretMoved = waitForEvent(EVENT_TEXT_CARET_MOVED, editableWithTextAndLink);
EventUtils.synthesizeKey("KEY_ArrowRight");
evt = await caretMoved;
is(
editableWithTextAndLink.caretOffset,
1,
"Caret offset is 1 after ArrowRight"
);
evt.QueryInterface(nsIAccessibleCaretMoveEvent);
ok(!evt.isAtEndOfLine, "Caret is not at end of line");
},
{ chrome: true, topLevel: true, iframe: true, remoteIframe: true }
);
Expand Down
4 changes: 4 additions & 0 deletions browser/app/distribution/distribution.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Global]
id=mozilla-official
version=1.0
about=Mozilla Firefox Official Build
12 changes: 12 additions & 0 deletions browser/app/distribution/moz.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.

DIST_SUBDIR = ""

if CONFIG["BUILT_BY_MOZILLA"]:
FINAL_TARGET_FILES.distribution += [
"distribution.ini",
]
2 changes: 2 additions & 0 deletions browser/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ with Files("profile/channel-prefs.js"):
with Files("profile/firefox.js"):
BUG_COMPONENT = ("Firefox", "General")

DIRS += ["distribution"]

if CONFIG["MOZ_MACBUNDLE_NAME"]:
DIRS += ["macbuild/Contents"]

Expand Down
27 changes: 19 additions & 8 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false, sticky);
pref("browser.urlbar.suggest.quicksuggest.sponsored", false, sticky);

// Whether online Firefox Suggest is available to the user. This is only
// relevant when Suggest overall is enabled [1]. When true, a checkbox will be
// shown in the settings UI allowing to the user to toggle online Suggest.
// relevant when Suggest overall is enabled [1].
//
// [1] browser.urlbar.quicksuggest.enabled
pref("browser.urlbar.quicksuggest.online.available", false);
Expand Down Expand Up @@ -658,7 +657,25 @@ pref("browser.urlbar.keepPanelOpenDuringImeComposition", false);
pref("browser.urlbar.groupLabels.enabled", true);

// The Merino endpoint URL, not including parameters.
#ifdef NIGHTLY_BUILD
pref("browser.urlbar.merino.endpointURL", "https://prod.merino.prod.webservices.mozgcp.net/api/v1/suggest");
#else
pref("browser.urlbar.merino.endpointURL", "https://merino.services.mozilla.com/api/v1/suggest");
#endif

// OHTTP config URL for Merino requests
#ifdef NIGHTLY_BUILD
pref("browser.urlbar.merino.ohttpConfigURL", "https://prod.merino.prod.webservices.mozgcp.net/ohttp-configs");
#else
pref("browser.urlbar.merino.ohttpConfigURL", "");
#endif

// OHTTP relay URL for Merino requests
#ifdef NIGHTLY_BUILD
pref("browser.urlbar.merino.ohttpRelayURL", "https://ohttp-merino.mozilla.fastly-edge.com");
#else
pref("browser.urlbar.merino.ohttpRelayURL", "");
#endif

// Timeout for Merino fetches (ms).
pref("browser.urlbar.merino.timeoutMs", 200);
Expand All @@ -669,12 +686,6 @@ pref("browser.urlbar.merino.providers", "");
// Comma-separated list of client variants to send to Merino
pref("browser.urlbar.merino.clientVariants", "");

// OHTTP config URL for Merino requests
pref("browser.urlbar.merino.ohttpConfigURL", "");

// OHTTP relay URL for Merino requests
pref("browser.urlbar.merino.ohttpRelayURL", "");

// OHTTP hpke for DAP
pref("dap.ohttp.hpke", "gAAgJSO22Y3HKzRSese15JtQVuuFfOIcTrZ56lQ5kDQwS0oABAABAAE");

Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/appmenu-viewcache.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
<image class="PanelUI-fxa-menu-vpn-button ctaMenuLogo" role="presentation" />
<label id="fxa-menu-header-title" crop="end" data-l10n-id="appmenuitem-vpn-title" />
</hbox>
<label id="cta-menu-header-description" crop="end" data-l10n-id="appmenuitem-vpn-description" />
<label id="cta-menu-header-description" crop="end" data-l10n-id="appmenuitem-vpn-description-2" />
</vbox>
</toolbarbutton>
</vbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ add_task(async function verify_distribution_info_hides() {

defaultBranch.setCharPref("distribution.id", "mozilla-test-distribution-id");
defaultBranch.setCharPref("distribution.version", "1.0");
if (
!(
AppConstants.platform === "win" &&
Services.sysinfo.getProperty("hasWinPackageId")
)
) {
defaultBranch.setCharPref("distribution.about", "");
}

let aboutDialog = await waitForAboutDialog();

Expand Down
3 changes: 0 additions & 3 deletions browser/base/content/test/siteIdentity/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ skip-if = [
]

["browser_identityPopup_qwacs.js"]
skip-if = [
"true", # Bug 2014612
]

["browser_identity_UI.js"]
https_first_disabled = true
Expand Down
2 changes: 1 addition & 1 deletion browser/components/aiwindow/models/Utils.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const DEFAULT_MODEL = Object.freeze({
* - Old clients will continue using old major version
*/
export const FEATURE_MAJOR_VERSIONS = Object.freeze({
[MODEL_FEATURES.CHAT]: 1,
[MODEL_FEATURES.CHAT]: 2,
[MODEL_FEATURES.TITLE_GENERATION]: 1,
[MODEL_FEATURES.CONVERSATION_SUGGESTIONS_SIDEBAR_STARTER]: 1,
[MODEL_FEATURES.CONVERSATION_SUGGESTIONS_FOLLOWUP]: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { BlockListManager } from "chrome://global/content/ml/Utils.sys.mjs";
// Chat fetch defaults
const DEFAULT_MAX_RESULTS = 50;
const DEFAULT_HALF_LIFE_DAYS = 7;
const MESSAGE_LENGTH_THRESHOLD = 1000;
const MS_PER_SEC = 1_000;
const SEC_PER_MIN = 60;
const MINS_PER_HOUR = 60;
Expand Down Expand Up @@ -71,10 +72,14 @@ export async function getRecentChats(
const chatMessages = filtered.map(msg => {
const createdDate = msg.createdDate;
const freshness_score = computeFreshnessScore(createdDate, halfLifeDays);
let content = msg.content?.body ?? null;
if (content && content.length > MESSAGE_LENGTH_THRESHOLD) {
content = content.substring(0, MESSAGE_LENGTH_THRESHOLD);
}
return {
createdDate,
role: msg.role,
content: msg.content?.body ?? null,
content,
pageUrl: msg.pageUrl,
freshness_score,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ChromeUtils.defineLazyGetter(lazy, "console", function () {
const INITIAL_MEMORIES_PAGES_THRESHOLD = 0;

// Only run if at least this many pages have been visited.
const MEMORIES_SCHEDULER_PAGES_THRESHOLD = 2;
const MEMORIES_SCHEDULER_PAGES_THRESHOLD = 30;

// Memories history schedule every 2 mins
const MEMORIES_SCHEDULER_INTERVAL_MS = 2 * 60 * 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ export async function getRecentHistory(opts = {}) {
const onlyTitle = row.getResultByName("title") || "";
let title;
if (onlyTitle) {
title = onlyTitle + " | " + host;
const sanitizedTitle = sanitizeTitle(onlyTitle);
title = sanitizedTitle + " | " + host;
} else {
title = onlyTitle;
}
Expand Down Expand Up @@ -761,11 +762,39 @@ function round2(x) {
return Math.round(Number(x) * 100) / 100;
}

/**
* Sanitize title text to prevent JSON parsing issues in LLM outputs.
* Removes/replaces characters that commonly cause problems:
* - Backslashes (replaced with forward slashes)
* - Control characters (replaced with spaces)
*
* @param {string} title - Raw title from Places database
* @returns {string} - Sanitized title
*/
function sanitizeTitle(title) {
if (typeof title !== "string") {
return "";
}

return (
title
.replace(/\\/g, "/") // Replace backslash with forward slash
// eslint-disable-next-line no-control-regex
.replace(/[\x00-\x1F\x7F]/g, " ") // Replace control chars (0-31, 127) with space
.replace(/\s+/g, " ") // Collapse multiple spaces
.trim()
);
}

// for tests only
export function _setBlockListManagerForTesting(mgr) {
_mgr = mgr;
}

export function _sanitizeTitleForTesting(title) {
return sanitizeTitle(title);
}

/**
* Return the number of history visits since `days` ago.
*
Expand Down
Loading
Loading