Skip to content

Commit 8fa69d0

Browse files
shakyShanegithub-actions[bot]
authored andcommitted
Release build 8.5.0 [ci release]
1 parent eb11d88 commit 8fa69d0

28 files changed

+653
-35
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- allow non-protection features to survive protections toggle (#1564)
1+
- add favicon feature (#1561)

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@
12681268
function isGloballyDisabled(args) {
12691269
return args.site.allowlisted || args.site.isBroken;
12701270
}
1271-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1271+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
12721272
function isPlatformSpecificFeature(featureName) {
12731273
return platformSpecificFeatures.includes(featureName);
12741274
}
@@ -1314,12 +1314,13 @@
13141314
"brokerProtection",
13151315
"performanceMetrics",
13161316
"breakageReporting",
1317-
"autofillPasswordImport"
1317+
"autofillPasswordImport",
1318+
"favicon"
13181319
]
13191320
);
13201321
var platformSupport = {
13211322
apple: ["webCompat", ...baseFeatures],
1322-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1323+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
13231324
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
13241325
"android-broker-protection": ["brokerProtection"],
13251326
"android-autofill-password-import": ["autofillPasswordImport"],

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@
18231823
function isGloballyDisabled(args) {
18241824
return args.site.allowlisted || args.site.isBroken;
18251825
}
1826-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1826+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
18271827
function isPlatformSpecificFeature(featureName) {
18281828
return platformSpecificFeatures.includes(featureName);
18291829
}
@@ -1869,12 +1869,13 @@
18691869
"brokerProtection",
18701870
"performanceMetrics",
18711871
"breakageReporting",
1872-
"autofillPasswordImport"
1872+
"autofillPasswordImport",
1873+
"favicon"
18731874
]
18741875
);
18751876
var platformSupport = {
18761877
apple: ["webCompat", ...baseFeatures],
1877-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1878+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
18781879
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
18791880
"android-broker-protection": ["brokerProtection"],
18801881
"android-autofill-password-import": ["autofillPasswordImport"],
@@ -11940,13 +11941,92 @@
1194011941
};
1194111942
var message_bridge_default = MessageBridge;
1194211943

11944+
// src/features/favicon.js
11945+
init_define_import_meta_trackerLookup();
11946+
var Favicon = class extends ContentFeature {
11947+
init() {
11948+
if (this.platform.name === "ios") return;
11949+
if (isBeingFramed()) return;
11950+
window.addEventListener("DOMContentLoaded", () => {
11951+
this.send();
11952+
this.monitorChanges();
11953+
});
11954+
}
11955+
monitorChanges() {
11956+
if (this.getFeatureSetting("monitor") === false) return;
11957+
let trailing;
11958+
let lastEmitTime = performance.now();
11959+
const interval = 50;
11960+
monitor(() => {
11961+
clearTimeout(trailing);
11962+
const currentTime = performance.now();
11963+
const delta = currentTime - lastEmitTime;
11964+
if (delta >= interval) {
11965+
this.send();
11966+
} else {
11967+
trailing = setTimeout(() => {
11968+
this.send();
11969+
}, 50);
11970+
}
11971+
lastEmitTime = currentTime;
11972+
});
11973+
}
11974+
send() {
11975+
const favicons = getFaviconList();
11976+
this.notify("faviconFound", { favicons, documentUrl: document.URL });
11977+
}
11978+
};
11979+
var favicon_default = Favicon;
11980+
function monitor(changeObservedCallback) {
11981+
const target = document.head;
11982+
if (!target) return;
11983+
const observer = new MutationObserver((mutations) => {
11984+
for (const mutation of mutations) {
11985+
if (mutation.type === "attributes" && mutation.target instanceof HTMLLinkElement) {
11986+
changeObservedCallback();
11987+
return;
11988+
}
11989+
if (mutation.type === "childList") {
11990+
for (const addedNode of mutation.addedNodes) {
11991+
if (addedNode instanceof HTMLLinkElement) {
11992+
changeObservedCallback();
11993+
return;
11994+
}
11995+
}
11996+
for (const removedNode of mutation.removedNodes) {
11997+
if (removedNode instanceof HTMLLinkElement) {
11998+
changeObservedCallback();
11999+
return;
12000+
}
12001+
}
12002+
}
12003+
}
12004+
});
12005+
observer.observe(target, { attributeFilter: ["rel", "href"], attributes: true, subtree: true, childList: true });
12006+
}
12007+
function getFaviconList() {
12008+
const selectors = [
12009+
"link[href][rel='favicon']",
12010+
"link[href][rel*='icon']",
12011+
"link[href][rel='apple-touch-icon']",
12012+
"link[href][rel='apple-touch-icon-precomposed']"
12013+
];
12014+
const elements = document.head.querySelectorAll(selectors.join(","));
12015+
return Array.from(elements).map((link) => {
12016+
const href = link.href || "";
12017+
const rel = link.getAttribute("rel") || "";
12018+
return { href, rel };
12019+
});
12020+
}
12021+
1194312022
// ddg:platformFeatures:ddg:platformFeatures
1194412023
var ddg_platformFeatures_default = {
1194512024
ddg_feature_duckPlayer: DuckPlayerFeature,
1194612025
ddg_feature_brokerProtection: BrokerProtection,
1194712026
ddg_feature_performanceMetrics: PerformanceMetrics,
1194812027
ddg_feature_clickToLoad: ClickToLoad,
11949-
ddg_feature_messageBridge: message_bridge_default
12028+
ddg_feature_messageBridge: message_bridge_default,
12029+
ddg_feature_favicon: favicon_default
1195012030
};
1195112031

1195212032
// src/content-scope-features.js

build/android/autofillPasswordImport.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
function isGloballyDisabled(args) {
410410
return args.site.allowlisted || args.site.isBroken;
411411
}
412-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
412+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
413413
function isPlatformSpecificFeature(featureName) {
414414
return platformSpecificFeatures.includes(featureName);
415415
}
@@ -480,12 +480,13 @@
480480
"brokerProtection",
481481
"performanceMetrics",
482482
"breakageReporting",
483-
"autofillPasswordImport"
483+
"autofillPasswordImport",
484+
"favicon"
484485
]
485486
);
486487
var platformSupport = {
487488
apple: ["webCompat", ...baseFeatures],
488-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
489+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
489490
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
490491
"android-broker-protection": ["brokerProtection"],
491492
"android-autofill-password-import": ["autofillPasswordImport"],

build/android/brokerProtection.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@
17871787
function isGloballyDisabled(args) {
17881788
return args.site.allowlisted || args.site.isBroken;
17891789
}
1790-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1790+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
17911791
function isPlatformSpecificFeature(featureName) {
17921792
return platformSpecificFeatures.includes(featureName);
17931793
}
@@ -1833,12 +1833,13 @@
18331833
"brokerProtection",
18341834
"performanceMetrics",
18351835
"breakageReporting",
1836-
"autofillPasswordImport"
1836+
"autofillPasswordImport",
1837+
"favicon"
18371838
]
18381839
);
18391840
var platformSupport = {
18401841
apple: ["webCompat", ...baseFeatures],
1841-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1842+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
18421843
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
18431844
"android-broker-protection": ["brokerProtection"],
18441845
"android-autofill-password-import": ["autofillPasswordImport"],

build/android/contentScope.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@
12681268
function isGloballyDisabled(args) {
12691269
return args.site.allowlisted || args.site.isBroken;
12701270
}
1271-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1271+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
12721272
function isPlatformSpecificFeature(featureName) {
12731273
return platformSpecificFeatures.includes(featureName);
12741274
}
@@ -1314,12 +1314,13 @@
13141314
"brokerProtection",
13151315
"performanceMetrics",
13161316
"breakageReporting",
1317-
"autofillPasswordImport"
1317+
"autofillPasswordImport",
1318+
"favicon"
13181319
]
13191320
);
13201321
var platformSupport = {
13211322
apple: ["webCompat", ...baseFeatures],
1322-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1323+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
13231324
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
13241325
"android-broker-protection": ["brokerProtection"],
13251326
"android-autofill-password-import": ["autofillPasswordImport"],

build/chrome-mv3/inject.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@
12171217
function isGloballyDisabled(args) {
12181218
return args.site.allowlisted || args.site.isBroken;
12191219
}
1220-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1220+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
12211221
function isPlatformSpecificFeature(featureName) {
12221222
return platformSpecificFeatures.includes(featureName);
12231223
}
@@ -1262,12 +1262,13 @@
12621262
"brokerProtection",
12631263
"performanceMetrics",
12641264
"breakageReporting",
1265-
"autofillPasswordImport"
1265+
"autofillPasswordImport",
1266+
"favicon"
12661267
]
12671268
);
12681269
var platformSupport = {
12691270
apple: ["webCompat", ...baseFeatures],
1270-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1271+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
12711272
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
12721273
"android-broker-protection": ["brokerProtection"],
12731274
"android-autofill-password-import": ["autofillPasswordImport"],

build/firefox/inject.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@
12171217
function isGloballyDisabled(args) {
12181218
return args.site.allowlisted || args.site.isBroken;
12191219
}
1220-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
1220+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
12211221
function isPlatformSpecificFeature(featureName) {
12221222
return platformSpecificFeatures.includes(featureName);
12231223
}
@@ -1262,12 +1262,13 @@
12621262
"brokerProtection",
12631263
"performanceMetrics",
12641264
"breakageReporting",
1265-
"autofillPasswordImport"
1265+
"autofillPasswordImport",
1266+
"favicon"
12661267
]
12671268
);
12681269
var platformSupport = {
12691270
apple: ["webCompat", ...baseFeatures],
1270-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
1271+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
12711272
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
12721273
"android-broker-protection": ["brokerProtection"],
12731274
"android-autofill-password-import": ["autofillPasswordImport"],

build/integration/contentScope.js

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,7 @@
27392739
function isGloballyDisabled(args) {
27402740
return args.site.allowlisted || args.site.isBroken;
27412741
}
2742-
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge"];
2742+
var platformSpecificFeatures = ["windowsPermissionUsage", "messageBridge", "favicon"];
27432743
function isPlatformSpecificFeature(featureName) {
27442744
return platformSpecificFeatures.includes(featureName);
27452745
}
@@ -2811,12 +2811,13 @@
28112811
"brokerProtection",
28122812
"performanceMetrics",
28132813
"breakageReporting",
2814-
"autofillPasswordImport"
2814+
"autofillPasswordImport",
2815+
"favicon"
28152816
]
28162817
);
28172818
var platformSupport = {
28182819
apple: ["webCompat", ...baseFeatures],
2819-
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge"],
2820+
"apple-isolated": ["duckPlayer", "brokerProtection", "performanceMetrics", "clickToLoad", "messageBridge", "favicon"],
28202821
android: [...baseFeatures, "webCompat", "breakageReporting", "duckPlayer", "messageBridge"],
28212822
"android-broker-protection": ["brokerProtection"],
28222823
"android-autofill-password-import": ["autofillPasswordImport"],
@@ -16632,6 +16633,84 @@
1663216633
_domLoaded = new WeakMap();
1663316634
_tappedElements = new WeakMap();
1663416635

16636+
// src/features/favicon.js
16637+
init_define_import_meta_trackerLookup();
16638+
var Favicon = class extends ContentFeature {
16639+
init() {
16640+
if (this.platform.name === "ios") return;
16641+
if (isBeingFramed()) return;
16642+
window.addEventListener("DOMContentLoaded", () => {
16643+
this.send();
16644+
this.monitorChanges();
16645+
});
16646+
}
16647+
monitorChanges() {
16648+
if (this.getFeatureSetting("monitor") === false) return;
16649+
let trailing;
16650+
let lastEmitTime = performance.now();
16651+
const interval = 50;
16652+
monitor(() => {
16653+
clearTimeout(trailing);
16654+
const currentTime = performance.now();
16655+
const delta = currentTime - lastEmitTime;
16656+
if (delta >= interval) {
16657+
this.send();
16658+
} else {
16659+
trailing = setTimeout(() => {
16660+
this.send();
16661+
}, 50);
16662+
}
16663+
lastEmitTime = currentTime;
16664+
});
16665+
}
16666+
send() {
16667+
const favicons = getFaviconList();
16668+
this.notify("faviconFound", { favicons, documentUrl: document.URL });
16669+
}
16670+
};
16671+
var favicon_default = Favicon;
16672+
function monitor(changeObservedCallback) {
16673+
const target = document.head;
16674+
if (!target) return;
16675+
const observer = new MutationObserver((mutations) => {
16676+
for (const mutation of mutations) {
16677+
if (mutation.type === "attributes" && mutation.target instanceof HTMLLinkElement) {
16678+
changeObservedCallback();
16679+
return;
16680+
}
16681+
if (mutation.type === "childList") {
16682+
for (const addedNode of mutation.addedNodes) {
16683+
if (addedNode instanceof HTMLLinkElement) {
16684+
changeObservedCallback();
16685+
return;
16686+
}
16687+
}
16688+
for (const removedNode of mutation.removedNodes) {
16689+
if (removedNode instanceof HTMLLinkElement) {
16690+
changeObservedCallback();
16691+
return;
16692+
}
16693+
}
16694+
}
16695+
}
16696+
});
16697+
observer.observe(target, { attributeFilter: ["rel", "href"], attributes: true, subtree: true, childList: true });
16698+
}
16699+
function getFaviconList() {
16700+
const selectors = [
16701+
"link[href][rel='favicon']",
16702+
"link[href][rel*='icon']",
16703+
"link[href][rel='apple-touch-icon']",
16704+
"link[href][rel='apple-touch-icon-precomposed']"
16705+
];
16706+
const elements = document.head.querySelectorAll(selectors.join(","));
16707+
return Array.from(elements).map((link) => {
16708+
const href = link.href || "";
16709+
const rel = link.getAttribute("rel") || "";
16710+
return { href, rel };
16711+
});
16712+
}
16713+
1663516714
// ddg:platformFeatures:ddg:platformFeatures
1663616715
var ddg_platformFeatures_default = {
1663716716
ddg_feature_fingerprintingAudio: FingerprintingAudio,
@@ -16657,7 +16736,8 @@
1665716736
ddg_feature_brokerProtection: BrokerProtection,
1665816737
ddg_feature_performanceMetrics: PerformanceMetrics,
1665916738
ddg_feature_breakageReporting: BreakageReporting,
16660-
ddg_feature_autofillPasswordImport: AutofillPasswordImport
16739+
ddg_feature_autofillPasswordImport: AutofillPasswordImport,
16740+
ddg_feature_favicon: favicon_default
1666116741
};
1666216742

1666316743
// src/content-scope-features.js

0 commit comments

Comments
 (0)