Skip to content

Commit 30b5b64

Browse files
shakyShanegithub-actions[bot]
authored andcommitted
Release build 10.2.0 [ci release]
1 parent 2e1d9f5 commit 30b5b64

Some content is hidden

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

43 files changed

+1013
-55
lines changed

CHANGELOG.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
- Updated Release Notes page title (#1739)
1+
- ntp: accepting a new message to re-fetch favicons (#1775)
2+
- Check for API predence in Windows permissions (#1773)
3+
- build(deps-dev): bump prettier from 3.5.3 to 3.6.0 (#1764)
4+
- Add min supported version and integration testing (#1772)
5+
- Add API defining behaviour to apiManipulation (#1771)
6+
- Update config to v5 (#1770)

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3707,6 +3707,7 @@
37073707
/**
37083708
* @type {{
37093709
* debug?: boolean,
3710+
* platform: import('./utils.js').Platform,
37103711
* desktopModeEnabled?: boolean,
37113712
* forcedZoomEnabled?: boolean,
37123713
* featureSettings?: Record<string, unknown>,
@@ -3778,6 +3779,7 @@
37783779
* @typedef {object} ConditionBlock
37793780
* @property {string[] | string} [domain]
37803781
* @property {object} [urlPattern]
3782+
* @property {object} [minSupportedVersion]
37813783
* @property {object} [experiment]
37823784
* @property {string} [experiment.experimentName]
37833785
* @property {string} [experiment.cohort]
@@ -3803,7 +3805,8 @@
38033805
const conditionChecks = {
38043806
domain: this._matchDomainConditional,
38053807
urlPattern: this._matchUrlPatternConditional,
3806-
experiment: this._matchExperimentConditional
3808+
experiment: this._matchExperimentConditional,
3809+
minSupportedVersion: this._matchMinSupportedVersion
38073810
};
38083811
for (const key in conditionBlock) {
38093812
if (!conditionChecks[key]) {
@@ -3867,6 +3870,15 @@
38673870
}
38683871
return matchHostname(domain, conditionBlock.domain);
38693872
}
3873+
/**
3874+
* Takes a condition block and returns true if the platform version satisfies the `minSupportedFeature`
3875+
* @param {ConditionBlock} conditionBlock
3876+
* @returns {boolean}
3877+
*/
3878+
_matchMinSupportedVersion(conditionBlock) {
3879+
if (!conditionBlock.minSupportedVersion) return false;
3880+
return isSupportedVersion(conditionBlock.minSupportedVersion, __privateGet(this, _args)?.platform?.version);
3881+
}
38703882
/**
38713883
* Return the settings object for a feature
38723884
* @param {string} [featureName] - The name of the feature to get the settings for; defaults to the name of the feature
@@ -10665,6 +10677,9 @@ Only "elements" is supported.`);
1066510677
if (change.configurable && typeof change.configurable !== "boolean") {
1066610678
return false;
1066710679
}
10680+
if ("define" in change && typeof change.define !== "boolean") {
10681+
return false;
10682+
}
1066810683
return typeof change.getterValue !== "undefined";
1066910684
}
1067010685
return false;
@@ -10678,6 +10693,7 @@ Only "elements" is supported.`);
1067810693
* @property {import('../utils.js').ConfigSetting} [getterValue] - The value returned from a getter.
1067910694
* @property {boolean} [enumerable] - Whether the property is enumerable.
1068010695
* @property {boolean} [configurable] - Whether the property is configurable.
10696+
* @property {boolean} [define] - Whether to define the property if it does not exist.
1068110697
*/
1068210698
/**
1068310699
* Applies a change to DOM APIs.
@@ -10728,6 +10744,15 @@ Only "elements" is supported.`);
1072810744
if ("configurable" in change) {
1072910745
descriptor.configurable = change.configurable;
1073010746
}
10747+
if (change.define === true && !(key in api)) {
10748+
const defineDescriptor = {
10749+
...descriptor,
10750+
enumerable: typeof descriptor.enumerable !== "boolean" ? true : descriptor.enumerable,
10751+
configurable: typeof descriptor.configurable !== "boolean" ? true : descriptor.configurable
10752+
};
10753+
this.defineProperty(api, key, defineDescriptor);
10754+
return;
10755+
}
1073110756
this.wrapProperty(api, key, descriptor);
1073210757
}
1073310758
}

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4412,6 +4412,7 @@
44124412
/**
44134413
* @type {{
44144414
* debug?: boolean,
4415+
* platform: import('./utils.js').Platform,
44154416
* desktopModeEnabled?: boolean,
44164417
* forcedZoomEnabled?: boolean,
44174418
* featureSettings?: Record<string, unknown>,
@@ -4483,6 +4484,7 @@
44834484
* @typedef {object} ConditionBlock
44844485
* @property {string[] | string} [domain]
44854486
* @property {object} [urlPattern]
4487+
* @property {object} [minSupportedVersion]
44864488
* @property {object} [experiment]
44874489
* @property {string} [experiment.experimentName]
44884490
* @property {string} [experiment.cohort]
@@ -4508,7 +4510,8 @@
45084510
const conditionChecks = {
45094511
domain: this._matchDomainConditional,
45104512
urlPattern: this._matchUrlPatternConditional,
4511-
experiment: this._matchExperimentConditional
4513+
experiment: this._matchExperimentConditional,
4514+
minSupportedVersion: this._matchMinSupportedVersion
45124515
};
45134516
for (const key in conditionBlock) {
45144517
if (!conditionChecks[key]) {
@@ -4572,6 +4575,15 @@
45724575
}
45734576
return matchHostname(domain, conditionBlock.domain);
45744577
}
4578+
/**
4579+
* Takes a condition block and returns true if the platform version satisfies the `minSupportedFeature`
4580+
* @param {ConditionBlock} conditionBlock
4581+
* @returns {boolean}
4582+
*/
4583+
_matchMinSupportedVersion(conditionBlock) {
4584+
if (!conditionBlock.minSupportedVersion) return false;
4585+
return isSupportedVersion(conditionBlock.minSupportedVersion, __privateGet(this, _args)?.platform?.version);
4586+
}
45754587
/**
45764588
* Return the settings object for a feature
45774589
* @param {string} [featureName] - The name of the feature to get the settings for; defaults to the name of the feature

Sources/ContentScopeScripts/dist/pages/new-tab/dist/index.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,6 +1975,13 @@
19751975
onConfig(cb) {
19761976
return this.configService.onData(cb);
19771977
}
1978+
onFaviconsRefreshed(cb) {
1979+
return this.ntp.messaging.subscribe("favorites_onRefresh", (data2) => {
1980+
if (data2.items.some((item) => item.kind === "favicons")) {
1981+
cb();
1982+
}
1983+
});
1984+
}
19781985
/**
19791986
* Update the in-memory data immediate and persist.
19801987
* Any state changes will be broadcast to consumers synchronously
@@ -2227,7 +2234,14 @@
22272234
},
22282235
[service]
22292236
);
2230-
return /* @__PURE__ */ _(FavoritesContext.Provider, { value: { state, toggle, favoritesDidReOrder, openFavorite, openContextMenu, add: add2, onConfigChanged } }, /* @__PURE__ */ _(FavoritesDispatchContext.Provider, { value: dispatch }, children));
2237+
const faviconsRefreshedCount = useSignal(0);
2238+
y2(() => {
2239+
if (!service.current) return;
2240+
return service.current.onFaviconsRefreshed(() => {
2241+
faviconsRefreshedCount.value = faviconsRefreshedCount.value += 1;
2242+
});
2243+
}, []);
2244+
return /* @__PURE__ */ _(FavoritesContext.Provider, { value: { state, toggle, favoritesDidReOrder, openFavorite, openContextMenu, add: add2, onConfigChanged } }, /* @__PURE__ */ _(FaviconsRefreshedCount.Provider, { value: faviconsRefreshedCount }, /* @__PURE__ */ _(FavoritesDispatchContext.Provider, { value: dispatch }, children)));
22312245
}
22322246
function useService() {
22332247
const service = A2(
@@ -2244,7 +2258,10 @@
22442258
}, [ntp]);
22452259
return service;
22462260
}
2247-
var FavoritesContext, FavoritesDispatchContext;
2261+
function useFaviconRefreshedCount() {
2262+
return x2(FaviconsRefreshedCount);
2263+
}
2264+
var FavoritesContext, FavoritesDispatchContext, FaviconsRefreshedCount;
22482265
var init_FavoritesProvider = __esm({
22492266
"pages/new-tab/app/favorites/components/FavoritesProvider.js"() {
22502267
"use strict";
@@ -2253,6 +2270,7 @@
22532270
init_favorites_service();
22542271
init_types();
22552272
init_service_hooks();
2273+
init_signals_module();
22562274
FavoritesContext = K({
22572275
/** @type {import('../../service.hooks.js').State<FavoritesData, FavoritesConfig>} */
22582276
state: { status: "idle", data: null, config: null },
@@ -2284,6 +2302,7 @@
22842302
/** @type {import("preact/hooks").Dispatch<Events>} */
22852303
{}
22862304
);
2305+
FaviconsRefreshedCount = K(d3(0));
22872306
}
22882307
});
22892308

@@ -5572,6 +5591,7 @@
55725591
init_compat_module();
55735592
init_Favorites2();
55745593
init_hooks_module();
5594+
init_FavoritesProvider();
55755595
TileRow = M2(
55765596
/**
55775597
* Represents a row of tiles with optional placeholders to fill empty spaces in the first row.
@@ -5584,6 +5604,7 @@
55845604
function TileRow2({ topOffset, items, add: add2, visibility }) {
55855605
const fillers = ROW_CAPACITY - items.length;
55865606
const { theme, animateItems } = x2(FavoritesThemeContext);
5607+
const count = useFaviconRefreshedCount();
55875608
return /* @__PURE__ */ _("ul", { className: Favorites_default.gridRow, style: { transform: `translateY(${topOffset}px)` } }, items.map((item, index2) => {
55885609
return /* @__PURE__ */ _(
55895610
Tile,
@@ -5593,7 +5614,7 @@
55935614
faviconSrc: item.favicon?.src,
55945615
faviconMax: item.favicon?.maxAvailableSize,
55955616
title: item.title,
5596-
key: item.id + item.favicon?.src + item.favicon?.maxAvailableSize + visibility,
5617+
key: item.id + item.favicon?.src + item.favicon?.maxAvailableSize + visibility + count.value,
55975618
id: item.id,
55985619
index: index2,
55995620
visibility,
@@ -28041,6 +28062,18 @@
2804128062
/** @type {Favorite[]} */
2804228063
favorites: []
2804328064
},
28065+
missing: {
28066+
/** @type {Favorite[]} */
28067+
favorites: [
28068+
{
28069+
id: "id-missing-1",
28070+
etldPlusOne: "adobe.com",
28071+
url: "https://adobe.com?id=id-many-3",
28072+
title: "Adobe",
28073+
favicon: { src: "./this-does-note-exist", maxAvailableSize: 16 }
28074+
}
28075+
]
28076+
},
2804428077
titles: {
2804528078
/** @type {Favorite[]} */
2804628079
favorites: [

build/android/autofillPasswordImport.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,7 @@
28352835
/**
28362836
* @type {{
28372837
* debug?: boolean,
2838+
* platform: import('./utils.js').Platform,
28382839
* desktopModeEnabled?: boolean,
28392840
* forcedZoomEnabled?: boolean,
28402841
* featureSettings?: Record<string, unknown>,
@@ -2906,6 +2907,7 @@
29062907
* @typedef {object} ConditionBlock
29072908
* @property {string[] | string} [domain]
29082909
* @property {object} [urlPattern]
2910+
* @property {object} [minSupportedVersion]
29092911
* @property {object} [experiment]
29102912
* @property {string} [experiment.experimentName]
29112913
* @property {string} [experiment.cohort]
@@ -2931,7 +2933,8 @@
29312933
const conditionChecks = {
29322934
domain: this._matchDomainConditional,
29332935
urlPattern: this._matchUrlPatternConditional,
2934-
experiment: this._matchExperimentConditional
2936+
experiment: this._matchExperimentConditional,
2937+
minSupportedVersion: this._matchMinSupportedVersion
29352938
};
29362939
for (const key in conditionBlock) {
29372940
if (!conditionChecks[key]) {
@@ -2995,6 +2998,15 @@
29952998
}
29962999
return matchHostname(domain, conditionBlock.domain);
29973000
}
3001+
/**
3002+
* Takes a condition block and returns true if the platform version satisfies the `minSupportedFeature`
3003+
* @param {ConditionBlock} conditionBlock
3004+
* @returns {boolean}
3005+
*/
3006+
_matchMinSupportedVersion(conditionBlock) {
3007+
if (!conditionBlock.minSupportedVersion) return false;
3008+
return isSupportedVersion(conditionBlock.minSupportedVersion, __privateGet(this, _args)?.platform?.version);
3009+
}
29983010
/**
29993011
* Return the settings object for a feature
30003012
* @param {string} [featureName] - The name of the feature to get the settings for; defaults to the name of the feature

build/android/brokerProtection.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4378,6 +4378,7 @@
43784378
/**
43794379
* @type {{
43804380
* debug?: boolean,
4381+
* platform: import('./utils.js').Platform,
43814382
* desktopModeEnabled?: boolean,
43824383
* forcedZoomEnabled?: boolean,
43834384
* featureSettings?: Record<string, unknown>,
@@ -4449,6 +4450,7 @@
44494450
* @typedef {object} ConditionBlock
44504451
* @property {string[] | string} [domain]
44514452
* @property {object} [urlPattern]
4453+
* @property {object} [minSupportedVersion]
44524454
* @property {object} [experiment]
44534455
* @property {string} [experiment.experimentName]
44544456
* @property {string} [experiment.cohort]
@@ -4474,7 +4476,8 @@
44744476
const conditionChecks = {
44754477
domain: this._matchDomainConditional,
44764478
urlPattern: this._matchUrlPatternConditional,
4477-
experiment: this._matchExperimentConditional
4479+
experiment: this._matchExperimentConditional,
4480+
minSupportedVersion: this._matchMinSupportedVersion
44784481
};
44794482
for (const key in conditionBlock) {
44804483
if (!conditionChecks[key]) {
@@ -4538,6 +4541,15 @@
45384541
}
45394542
return matchHostname(domain, conditionBlock.domain);
45404543
}
4544+
/**
4545+
* Takes a condition block and returns true if the platform version satisfies the `minSupportedFeature`
4546+
* @param {ConditionBlock} conditionBlock
4547+
* @returns {boolean}
4548+
*/
4549+
_matchMinSupportedVersion(conditionBlock) {
4550+
if (!conditionBlock.minSupportedVersion) return false;
4551+
return isSupportedVersion(conditionBlock.minSupportedVersion, __privateGet(this, _args)?.platform?.version);
4552+
}
45414553
/**
45424554
* Return the settings object for a feature
45434555
* @param {string} [featureName] - The name of the feature to get the settings for; defaults to the name of the feature

build/android/contentScope.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4218,6 +4218,7 @@
42184218
/**
42194219
* @type {{
42204220
* debug?: boolean,
4221+
* platform: import('./utils.js').Platform,
42214222
* desktopModeEnabled?: boolean,
42224223
* forcedZoomEnabled?: boolean,
42234224
* featureSettings?: Record<string, unknown>,
@@ -4289,6 +4290,7 @@
42894290
* @typedef {object} ConditionBlock
42904291
* @property {string[] | string} [domain]
42914292
* @property {object} [urlPattern]
4293+
* @property {object} [minSupportedVersion]
42924294
* @property {object} [experiment]
42934295
* @property {string} [experiment.experimentName]
42944296
* @property {string} [experiment.cohort]
@@ -4314,7 +4316,8 @@
43144316
const conditionChecks = {
43154317
domain: this._matchDomainConditional,
43164318
urlPattern: this._matchUrlPatternConditional,
4317-
experiment: this._matchExperimentConditional
4319+
experiment: this._matchExperimentConditional,
4320+
minSupportedVersion: this._matchMinSupportedVersion
43184321
};
43194322
for (const key in conditionBlock) {
43204323
if (!conditionChecks[key]) {
@@ -4378,6 +4381,15 @@
43784381
}
43794382
return matchHostname(domain, conditionBlock.domain);
43804383
}
4384+
/**
4385+
* Takes a condition block and returns true if the platform version satisfies the `minSupportedFeature`
4386+
* @param {ConditionBlock} conditionBlock
4387+
* @returns {boolean}
4388+
*/
4389+
_matchMinSupportedVersion(conditionBlock) {
4390+
if (!conditionBlock.minSupportedVersion) return false;
4391+
return isSupportedVersion(conditionBlock.minSupportedVersion, __privateGet(this, _args)?.platform?.version);
4392+
}
43814393
/**
43824394
* Return the settings object for a feature
43834395
* @param {string} [featureName] - The name of the feature to get the settings for; defaults to the name of the feature
@@ -6149,6 +6161,9 @@
61496161
if (change.configurable && typeof change.configurable !== "boolean") {
61506162
return false;
61516163
}
6164+
if ("define" in change && typeof change.define !== "boolean") {
6165+
return false;
6166+
}
61526167
return typeof change.getterValue !== "undefined";
61536168
}
61546169
return false;
@@ -6162,6 +6177,7 @@
61626177
* @property {import('../utils.js').ConfigSetting} [getterValue] - The value returned from a getter.
61636178
* @property {boolean} [enumerable] - Whether the property is enumerable.
61646179
* @property {boolean} [configurable] - Whether the property is configurable.
6180+
* @property {boolean} [define] - Whether to define the property if it does not exist.
61656181
*/
61666182
/**
61676183
* Applies a change to DOM APIs.
@@ -6212,6 +6228,15 @@
62126228
if ("configurable" in change) {
62136229
descriptor.configurable = change.configurable;
62146230
}
6231+
if (change.define === true && !(key in api)) {
6232+
const defineDescriptor = {
6233+
...descriptor,
6234+
enumerable: typeof descriptor.enumerable !== "boolean" ? true : descriptor.enumerable,
6235+
configurable: typeof descriptor.configurable !== "boolean" ? true : descriptor.configurable
6236+
};
6237+
this.defineProperty(api, key, defineDescriptor);
6238+
return;
6239+
}
62156240
this.wrapProperty(api, key, descriptor);
62166241
}
62176242
}

0 commit comments

Comments
 (0)