Skip to content

Commit ddc78d8

Browse files
Release build 8.16.0 [ci release]
1 parent 9d06fed commit ddc78d8

File tree

29 files changed

+1215
-158
lines changed

29 files changed

+1215
-158
lines changed

CHANGELOG.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
- ntp: reactive updates for theme values (#1635)
2-
- Add ad blocking variants to v3 onboarding (#1623)
3-
- Adapt Activity & Privacy Stats widgets for ads and trackers (#1621)
4-
- build(deps-dev): bump @fingerprintjs/fingerprintjs from 4.5.1 to 4.6.2 (#1627)
5-
- build(deps): bump @rive-app/canvas-single from 2.26.4 to 2.26.9 (#1630)
6-
- build(deps-dev): bump fast-check from 3.23.2 to 4.1.1 (#1629)
7-
- Expand patching changes (#1606)
8-
- build(deps): bump @atlaskit/pragmatic-drag-and-drop from 1.5.0 to 1.5.2 (#1583)
9-
- build(deps-dev): bump eslint from 9.21.0 to 9.22.0 in the eslint group (#1551)
10-
- build(deps-dev): bump typescript-eslint from 8.27.0 to 8.29.1 (#1628)
11-
- build(deps-dev): bump @playwright/test from 1.50.1 to 1.51.1 (#1585)
12-
- build(deps-dev): bump the typescript group across 1 directory with 4 updates (#1618)
13-
- fixed integration tests for special-error pages (#1632)
14-
- build(deps-dev): bump esbuild from 0.25.0 to 0.25.2 (#1601)
15-
- bring back the build entry point to not break dev-firefox target in DDG extension (#1577)
1+
- include tests in codeowners for broker-protection (#1634)
2+
- ntp: improve styling on favorites tiles (#1637)
3+
- Support navigation based conditional matching (#1610)

CODEOWNERS

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ injected/src/element-hiding.js @duckduckgo/content-scope-scripts-owners @jonatha
77
injected/src/features/click-to-load.js @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
88
injected/src/features/click-to-load/ @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
99
injected/src/locales/click-to-load/ @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
10-
injected/src/features/broker-protection.js @duckduckgo/content-scope-scripts-owners @brianhall @shakyShane @madblex
11-
injected/src/features/broker-protection/ @duckduckgo/content-scope-scripts-owners @brianhall @shakyShane @madblex
1210
injected/src/features/autofill-password-import.js @duckduckgo/content-scope-scripts-owners @dbajpeyi
1311

12+
# Broker protection
13+
injected/src/features/broker-protection.js @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
14+
injected/src/features/broker-protection/ @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
15+
injected/integration-test/page-objects/broker-protection.js @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
16+
injected/integration-test/broker-protection-tests/ @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
17+
injected/integration-test/mocks/broker-protection/ @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
18+
injected/integration-test/test-pages/broker-protection/ @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection
19+
1420
# Platform owners
1521
Sources/ @duckduckgo/content-scope-scripts-owners @duckduckgo/apple-devs
1622
injected/entry-points/android.js @duckduckgo/content-scope-scripts-owners @duckduckgo/android-devs

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,10 @@
11831183
return unprotectedDomain;
11841184
}
11851185
function computeLimitedSiteObject() {
1186-
const topLevelHostname = getTabHostname();
1186+
const tabURL = getTabUrl();
11871187
return {
1188-
domain: topLevelHostname,
1189-
url: getTabUrl()?.href || null
1188+
domain: tabURL?.hostname || null,
1189+
url: tabURL?.href || null
11901190
};
11911191
}
11921192
function getPlatformVersion(preferences) {
@@ -3650,6 +3650,15 @@
36503650
__privateGet(this, _args).featureSettings = parseFeatureSettings(bundledConfig, enabledFeatures);
36513651
}
36523652
}
3653+
/**
3654+
* Call this when the top URL has changed, to recompute the site object.
3655+
* This is used to update the path matching for urlPattern.
3656+
*/
3657+
recomputeSiteObject() {
3658+
if (__privateGet(this, _args)) {
3659+
__privateGet(this, _args).site = computeLimitedSiteObject();
3660+
}
3661+
}
36533662
get args() {
36543663
return __privateGet(this, _args);
36553664
}
@@ -3903,6 +3912,11 @@
39033912
__privateAdd(this, _messaging);
39043913
/** @type {boolean} */
39053914
__privateAdd(this, _isDebugFlagSet, false);
3915+
/**
3916+
* Set this to true if you wish to listen to top level URL changes for config matching.
3917+
* @type {boolean}
3918+
*/
3919+
__publicField(this, "listenForUrlChanges", false);
39063920
/** @type {ImportMeta} */
39073921
__privateAdd(this, _importConfig);
39083922
this.setArgs(this.args);
@@ -6562,16 +6576,12 @@
65626576
} else {
65636577
applyRules(activeRules);
65646578
}
6565-
const historyMethodProxy = new DDGProxy(this, History.prototype, "pushState", {
6566-
apply(target, thisArg, args) {
6567-
applyRules(activeRules);
6568-
return DDGReflect.apply(target, thisArg, args);
6569-
}
6570-
});
6571-
historyMethodProxy.overload();
6572-
window.addEventListener("popstate", () => {
6573-
applyRules(activeRules);
6574-
});
6579+
this.activeRules = activeRules;
6580+
}
6581+
urlChanged() {
6582+
if (this.activeRules) {
6583+
this.applyRules(this.activeRules);
6584+
}
65756585
}
65766586
/**
65776587
* Apply relevant hiding rules to page at set intervals
@@ -6626,6 +6636,10 @@
66266636
// src/features/api-manipulation.js
66276637
init_define_import_meta_trackerLookup();
66286638
var ApiManipulation = class extends ContentFeature {
6639+
constructor() {
6640+
super(...arguments);
6641+
__publicField(this, "listenForUrlChanges", true);
6642+
}
66296643
init() {
66306644
const apiChanges = this.getFeatureSetting("apiChanges");
66316645
if (apiChanges) {
@@ -6638,6 +6652,9 @@
66386652
}
66396653
}
66406654
}
6655+
urlChanged() {
6656+
this.init();
6657+
}
66416658
/**
66426659
* Checks if the config API change is valid.
66436660
* @param {any} change
@@ -6763,6 +6780,44 @@
67636780
ddg_feature_apiManipulation: ApiManipulation
67646781
};
67656782

6783+
// src/url-change.js
6784+
init_define_import_meta_trackerLookup();
6785+
var urlChangeListeners = /* @__PURE__ */ new Set();
6786+
function registerForURLChanges(listener) {
6787+
if (urlChangeListeners.size === 0) {
6788+
listenForURLChanges();
6789+
}
6790+
urlChangeListeners.add(listener);
6791+
}
6792+
function handleURLChange() {
6793+
for (const listener of urlChangeListeners) {
6794+
listener();
6795+
}
6796+
}
6797+
function listenForURLChanges() {
6798+
const urlChangedInstance = new ContentFeature("urlChanged", {}, {});
6799+
if ("navigation" in globalThis && "addEventListener" in globalThis.navigation) {
6800+
globalThis.navigation.addEventListener("navigatesuccess", () => {
6801+
handleURLChange();
6802+
});
6803+
return;
6804+
}
6805+
if (isBeingFramed()) {
6806+
return;
6807+
}
6808+
const historyMethodProxy = new DDGProxy(urlChangedInstance, History.prototype, "pushState", {
6809+
apply(target, thisArg, args) {
6810+
const changeResult = DDGReflect.apply(target, thisArg, args);
6811+
handleURLChange();
6812+
return changeResult;
6813+
}
6814+
});
6815+
historyMethodProxy.overload();
6816+
window.addEventListener("popstate", () => {
6817+
handleURLChange();
6818+
});
6819+
}
6820+
67666821
// src/content-scope-features.js
67676822
var initArgs = null;
67686823
var updates = [];
@@ -6803,6 +6858,12 @@
68036858
resolvedFeatures.forEach(({ featureInstance: featureInstance2, featureName }) => {
68046859
if (!isFeatureBroken(args, featureName) || alwaysInitExtensionFeatures(args, featureName)) {
68056860
featureInstance2.callInit(args);
6861+
if (featureInstance2.listenForUrlChanges || featureInstance2.urlChanged) {
6862+
registerForURLChanges(() => {
6863+
featureInstance2.recomputeSiteObject();
6864+
featureInstance2?.urlChanged();
6865+
});
6866+
}
68066867
}
68076868
});
68086869
while (updates.length) {

0 commit comments

Comments
 (0)