Skip to content

Commit c878c78

Browse files
Merge pull request #33 from Floorp-Projects/sync/nora-0.2.0/upstream-no-version-20260130-115943
sync: no_version_change upstream 147.0.3
2 parents f18225a + e1119e8 commit c878c78

File tree

190 files changed

+946
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+946
-342
lines changed

browser/components/newtab/AboutNewTabRedirector.sys.mjs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,17 +517,12 @@ export class AboutNewTabRedirectorParent extends BaseAboutNewTabRedirector {
517517
}
518518

519519
/**
520-
* Returns a Promise that reoslves when the newtab built-in addon has notified
521-
* that it has finished initializing. If this is somehow checked when
522-
* BROWSER_NEWTAB_AS_ADDON is not true, then this always resolves.
520+
* Returns a Promise that resolves when the newtab built-in addon has notified
521+
* that it has finished initializing.
523522
*
524523
* @type {Promise<undefined>}
525524
*/
526525
get promiseBuiltInAddonInitialized() {
527-
if (!AppConstants.BROWSER_NEWTAB_AS_ADDON) {
528-
return Promise.resolve();
529-
}
530-
531526
return this.#addonInitializedPromise;
532527
}
533528

@@ -547,7 +542,7 @@ export class AboutNewTabRedirectorParent extends BaseAboutNewTabRedirector {
547542
);
548543
resultChannel.originalURI = uri;
549544

550-
if (AppConstants.BROWSER_NEWTAB_AS_ADDON && !this.#addonInitialized) {
545+
if (!this.#addonInitialized) {
551546
return this.#getSuspendedChannel(resultChannel);
552547
}
553548

browser/components/newtab/test/browser/abouthomecache/browser_no_startup_actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ add_task(async function test_no_startup_actions() {
4040
// The following two statements seem to be enough to simulate Activity
4141
// Stream starting up.
4242
AboutNewTab.activityStream.uninit();
43-
AboutNewTab.onBrowserReady();
43+
await AboutNewTab.onBrowserReady();
4444

4545
// Much of Activity Stream initializes asynchronously. This is the easiest way
4646
// I could find to ensure that enough of the feeds had initialized to produce

browser/components/newtab/test/xpcshell/test_nimbus_newtabTrainhopAddon_onBrowserReady.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ add_task(
3535
const { nimbusFeatureCleanup } = await setupNimbusTrainhopAddon({
3636
updateAddonVersion,
3737
});
38-
AboutNewTab.onBrowserReady();
38+
await AboutNewTab.onBrowserReady();
3939
await promiseInstallPostponed;
4040
const { pendingInstall } = await asyncAssertNimbusTrainhopAddonStaged({
4141
updateAddonVersion,

browser/components/preferences/privacy.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,21 +3573,6 @@ var gPrivacyPane = {
35733573

35743574
setSyncFromPrefListener("savePasswords", () => this.readSavePasswords());
35753575

3576-
if (AlertsServiceDND) {
3577-
let notificationsDoNotDisturbBox = document.getElementById(
3578-
"notificationsDoNotDisturbBox"
3579-
);
3580-
notificationsDoNotDisturbBox.removeAttribute("hidden");
3581-
let checkbox = document.getElementById("notificationsDoNotDisturb");
3582-
document.l10n.setAttributes(checkbox, "permissions-notification-pause");
3583-
if (AlertsServiceDND.manualDoNotDisturb) {
3584-
let notificationsDoNotDisturb = document.getElementById(
3585-
"notificationsDoNotDisturb"
3586-
);
3587-
notificationsDoNotDisturb.setAttribute("checked", true);
3588-
}
3589-
}
3590-
35913576
this.initSiteDataControls();
35923577

35933578
this.initCookieBannerHandling();

browser/extensions/moz.configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
set_config("BROWSER_NEWTAB_AS_ADDON", True)
2-
set_define("BROWSER_NEWTAB_AS_ADDON", True)
31
set_config("MOZ_JAR_MAKER_FILE_FORMAT", "jar")

browser/extensions/newtab/legacy-jar.mn

Lines changed: 0 additions & 20 deletions
This file was deleted.

browser/extensions/newtab/lib/ActivityStream.sys.mjs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,12 @@ export const PREFS_CONFIG = new Map([
14391439

14401440
// Array of each feed's FEEDS_CONFIG factory and values to add to PREFS_CONFIG
14411441
const FEEDS_DATA = [
1442+
{
1443+
name: "startupcacheinit",
1444+
factory: () => new lazy.StartupCacheInit(),
1445+
title: "Sends a copy of the state to the startup cache newtab",
1446+
value: true,
1447+
},
14421448
{
14431449
name: "aboutpreferences",
14441450
factory: () => new lazy.AboutPreferences(),
@@ -1469,12 +1475,6 @@ const FEEDS_DATA = [
14691475
title: "Manages sections",
14701476
value: true,
14711477
},
1472-
{
1473-
name: "startupcacheinit",
1474-
factory: () => new lazy.StartupCacheInit(),
1475-
title: "Sends a copy of the state to the startup cache newtab",
1476-
value: true,
1477-
},
14781478
{
14791479
name: "section.highlights",
14801480
factory: () => new lazy.HighlightsFeed(),
@@ -1639,14 +1639,30 @@ for (const config of FEEDS_DATA) {
16391639
}
16401640

16411641
export class ActivityStream {
1642+
#createdInstant = null;
1643+
16421644
/**
16431645
* constructor - Initializes an instance of ActivityStream
1646+
*
1647+
* @param {Temporal.Instant} [createdInstant=null]
1648+
* The creation time of the current user profile.
16441649
*/
1645-
constructor() {
1650+
constructor(createdInstant) {
16461651
this.initialized = false;
16471652
this.store = new lazy.Store();
16481653
this._defaultPrefs = new lazy.DefaultPrefs(PREFS_CONFIG);
16491654
this._proxyRegistered = false;
1655+
this.#createdInstant = createdInstant ?? null;
1656+
}
1657+
1658+
/**
1659+
* Returns a Temporal.Instant for when the user profile was created, or null
1660+
* if that value was never passed to us in the constructor.
1661+
*
1662+
* @type {Temporal.Instant}
1663+
*/
1664+
get createdInstant() {
1665+
return this.#createdInstant;
16501666
}
16511667

16521668
get feeds() {

browser/extensions/newtab/moz.build

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ XPCSHELL_TESTS_MANIFESTS += [
1919
"test/xpcshell/xpcshell.toml",
2020
]
2121

22-
if CONFIG["BROWSER_NEWTAB_AS_ADDON"]:
23-
JAR_MANIFESTS += ["addon-jar.mn"]
24-
DIRS += ["webext-glue"]
25-
else:
26-
JAR_MANIFESTS += ["legacy-jar.mn"]
22+
JAR_MANIFESTS += ["addon-jar.mn"]
23+
24+
DIRS += ["webext-glue"]

browser/extensions/newtab/test/xpcshell/head.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ add_setup(async function head_initialize() {
7777
);
7878
await AddonTestUtils.promiseStartupManager();
7979

80-
if (AppConstants.BROWSER_NEWTAB_AS_ADDON) {
81-
Services.prefs.setBoolPref("extensions.experiments.enabled", true);
82-
await loadExtension();
83-
}
80+
Services.prefs.setBoolPref("extensions.experiments.enabled", true);
81+
await loadExtension();
8482
AboutNewTab.init();
8583
});
8684

browser/extensions/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const { TestUtils } = ChromeUtils.importESModule(
1818
const { sinon } = ChromeUtils.importESModule(
1919
"resource://testing-common/Sinon.sys.mjs"
2020
);
21+
const { NimbusTestUtils } = ChromeUtils.importESModule(
22+
"resource://testing-common/NimbusTestUtils.sys.mjs"
23+
);
2124

2225
SearchTestUtils.init(this);
2326

@@ -34,6 +37,8 @@ ChromeUtils.defineESModuleGetters(this, {
3437
const CACHE_WORKER_URL = "resource://newtab/lib/cache.worker.js";
3538
const NEWTAB_RENDER_URL = "resource://newtab/data/content/newtab-render.js";
3639

40+
NimbusTestUtils.init(this);
41+
3742
/**
3843
* In order to make this test less brittle, much of Activity Stream is
3944
* initialized here in order to generate a state object at runtime, rather
@@ -111,9 +116,12 @@ add_setup(async function () {
111116
{ setAsDefault: true }
112117
);
113118

119+
const { cleanup: nimbusTestCleanup } = await NimbusTestUtils.setupTest();
120+
registerCleanupFunction(nimbusTestCleanup);
121+
114122
// Pretend that a new window has been loaded to kick off initializing all of
115123
// the feeds.
116-
AboutNewTab.onBrowserReady();
124+
await AboutNewTab.onBrowserReady();
117125

118126
// Much of Activity Stream initializes asynchronously. This is the easiest way
119127
// I could find to ensure that enough of the feeds had initialized to produce

0 commit comments

Comments
 (0)