Skip to content

Commit 28aa2f8

Browse files
Release build 11.26.0 [ci release]
1 parent 4a3e996 commit 28aa2f8

File tree

12 files changed

+246
-410
lines changed

12 files changed

+246
-410
lines changed

CHANGELOG.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
- Set input's font size to 14px and textarea's line height to 16px on (#1963)
1+
- Improve telemetry gathering for page context (#1962)
2+
- build(deps-dev): bump wait-on from 8.0.4 to 8.0.5 (#1967)
3+
- Remove disableDeviceEnumeration feature as no longer used (#1964)

build/android/adsjsContentScope.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4049,9 +4049,6 @@
40494049
if (this.getFeatureSettingEnabled("modifyCookies")) {
40504050
this.modifyCookies();
40514051
}
4052-
if (this.getFeatureSettingEnabled("disableDeviceEnumeration")) {
4053-
this.preventDeviceEnumeration();
4054-
}
40554052
if (this.getFeatureSettingEnabled("enumerateDevices")) {
40564053
this.deviceEnumerationFix();
40574054
}
@@ -4608,32 +4605,6 @@
46084605
this.forceViewportTag(viewportTag, newContent.join(", "));
46094606
}
46104607
}
4611-
/**
4612-
* Prevents device enumeration by returning an empty array when enabled
4613-
*/
4614-
preventDeviceEnumeration() {
4615-
if (!window.MediaDevices) {
4616-
return;
4617-
}
4618-
let disableDeviceEnumeration = false;
4619-
const isFrame = window.self !== window.top;
4620-
if (isFrame) {
4621-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
4622-
} else {
4623-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
4624-
}
4625-
if (disableDeviceEnumeration) {
4626-
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
4627-
/**
4628-
* @returns {Promise<MediaDeviceInfo[]>}
4629-
*/
4630-
apply() {
4631-
return Promise.resolve([]);
4632-
}
4633-
});
4634-
enumerateDevicesProxy.overload();
4635-
}
4636-
}
46374608
/**
46384609
* Creates a valid MediaDeviceInfo or InputDeviceInfo object that passes instanceof checks
46394610
* @param {'videoinput' | 'audioinput' | 'audiooutput'} kind - The device kind

build/android/contentScope.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6789,9 +6789,6 @@
67896789
if (this.getFeatureSettingEnabled("modifyCookies")) {
67906790
this.modifyCookies();
67916791
}
6792-
if (this.getFeatureSettingEnabled("disableDeviceEnumeration")) {
6793-
this.preventDeviceEnumeration();
6794-
}
67956792
if (this.getFeatureSettingEnabled("enumerateDevices")) {
67966793
this.deviceEnumerationFix();
67976794
}
@@ -7348,32 +7345,6 @@
73487345
this.forceViewportTag(viewportTag, newContent.join(", "));
73497346
}
73507347
}
7351-
/**
7352-
* Prevents device enumeration by returning an empty array when enabled
7353-
*/
7354-
preventDeviceEnumeration() {
7355-
if (!window.MediaDevices) {
7356-
return;
7357-
}
7358-
let disableDeviceEnumeration = false;
7359-
const isFrame = window.self !== window.top;
7360-
if (isFrame) {
7361-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
7362-
} else {
7363-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
7364-
}
7365-
if (disableDeviceEnumeration) {
7366-
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
7367-
/**
7368-
* @returns {Promise<MediaDeviceInfo[]>}
7369-
*/
7370-
apply() {
7371-
return Promise.resolve([]);
7372-
}
7373-
});
7374-
enumerateDevicesProxy.overload();
7375-
}
7376-
}
73777348
/**
73787349
* Creates a valid MediaDeviceInfo or InputDeviceInfo object that passes instanceof checks
73797350
* @param {'videoinput' | 'audioinput' | 'audiooutput'} kind - The device kind

build/apple/contentScope.js

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4805,9 +4805,6 @@
48054805
if (this.getFeatureSettingEnabled("modifyCookies")) {
48064806
this.modifyCookies();
48074807
}
4808-
if (this.getFeatureSettingEnabled("disableDeviceEnumeration")) {
4809-
this.preventDeviceEnumeration();
4810-
}
48114808
if (this.getFeatureSettingEnabled("enumerateDevices")) {
48124809
this.deviceEnumerationFix();
48134810
}
@@ -5364,32 +5361,6 @@
53645361
this.forceViewportTag(viewportTag, newContent.join(", "));
53655362
}
53665363
}
5367-
/**
5368-
* Prevents device enumeration by returning an empty array when enabled
5369-
*/
5370-
preventDeviceEnumeration() {
5371-
if (!window.MediaDevices) {
5372-
return;
5373-
}
5374-
let disableDeviceEnumeration = false;
5375-
const isFrame = window.self !== window.top;
5376-
if (isFrame) {
5377-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumerationFrames");
5378-
} else {
5379-
disableDeviceEnumeration = this.getFeatureSettingEnabled("disableDeviceEnumeration");
5380-
}
5381-
if (disableDeviceEnumeration) {
5382-
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, "enumerateDevices", {
5383-
/**
5384-
* @returns {Promise<MediaDeviceInfo[]>}
5385-
*/
5386-
apply() {
5387-
return Promise.resolve([]);
5388-
}
5389-
});
5390-
enumerateDevicesProxy.overload();
5391-
}
5392-
}
53935364
/**
53945365
* Creates a valid MediaDeviceInfo or InputDeviceInfo object that passes instanceof checks
53955366
* @param {'videoinput' | 'audioinput' | 'audiooutput'} kind - The device kind
@@ -9617,6 +9588,7 @@ ul.messages {
96179588
this.log.info("Parsed page data:", pageDataParsed);
96189589
if (pageDataParsed.content) {
96199590
this.pageData = pageDataParsed;
9591+
this.promptTelemetry?.sendContextPixelInfo(pageDataParsed, DuckAiPromptTelemetry.CONTEXT_ATTACH_PIXEL_NAME);
96209592
if (this.contextPromiseResolve) {
96219593
this.contextPromiseResolve(true);
96229594
this.contextPromiseResolve = null;
@@ -9807,12 +9779,16 @@ ul.messages {
98079779
if (this.textBox !== element) {
98089780
this.textBox = element;
98099781
this.log.info("Found AI text box");
9810-
element.addEventListener("keyup", (event) => {
9811-
if (event.key === "Enter" && !event.shiftKey) {
9812-
this.log.info("Enter key pressed");
9813-
this.handleSendMessage();
9814-
}
9815-
});
9782+
element.addEventListener(
9783+
"keydown",
9784+
(event) => {
9785+
if (event.key === "Enter" && !event.shiftKey) {
9786+
this.log.info("Enter key pressed");
9787+
this.handleSendMessage();
9788+
}
9789+
},
9790+
true
9791+
);
98169792
this.setupValuePropertyDescriptor(element);
98179793
}
98189794
} else if (this.textBox) {
@@ -10025,11 +10001,11 @@ ${truncatedWarning}
1002510001
};
1002610002
const telemetryData = {
1002710003
totalPrompts: String(totalPrompts),
10028-
avgRawPromptSize: this.bucketSizeByThousands(avgRawPromptSize),
10004+
avgRawPromptSize: this.bucketSize(avgRawPromptSize),
1002910005
...createSizeFields("raw", rawSizeBuckets),
10030-
avgTotalPromptSize: this.bucketSizeByThousands(avgTotalPromptSize),
10006+
avgTotalPromptSize: this.bucketSize(avgTotalPromptSize),
1003110007
...createSizeFields("total", totalSizeBuckets),
10032-
avgContextSize: this.bucketSizeByThousands(avgContextSize),
10008+
avgContextSize: this.bucketSize(avgContextSize),
1003310009
contextUsageRate: String(Math.round(contextUsageRate * 100))
1003410010
};
1003510011
this.log.info("Sending daily telemetry pixel:", telemetryData);
@@ -10057,7 +10033,8 @@ ${truncatedWarning}
1005710033
if (!globalThis?.DDG?.pixel) {
1005810034
return;
1005910035
}
10060-
globalThis.DDG.pixel._pixels[_DuckAiPromptTelemetry.CONTEXT_PIXEL_NAME] = {};
10036+
globalThis.DDG.pixel._pixels[_DuckAiPromptTelemetry.CONTEXT_SEND_PIXEL_NAME] = {};
10037+
globalThis.DDG.pixel._pixels[_DuckAiPromptTelemetry.CONTEXT_ATTACH_PIXEL_NAME] = {};
1006110038
globalThis.DDG.pixel._pixels[_DuckAiPromptTelemetry.DAILY_PIXEL_NAME] = {};
1006210039
}
1006310040
/**
@@ -10072,28 +10049,28 @@ ${truncatedWarning}
1007210049
globalThis.DDG.pixel.fire(pixelName, params);
1007310050
}
1007410051
/**
10075-
* Bucket numbers by thousands for privacy-friendly reporting
10052+
* Bucket numbers by hundreds for privacy-friendly reporting
1007610053
* @param {number} number - Number to bucket
10077-
* @returns {string} Bucket lower bound (e.g., '0', '1000', '2000')
10054+
* @returns {string} Bucket lower bound (e.g., '0', '100', '200')
1007810055
*/
10079-
bucketSizeByThousands(number) {
10056+
bucketSize(number) {
1008010057
if (number <= 0) {
1008110058
return "0";
1008210059
}
10083-
const bucketIndex = Math.floor(number / 1e3);
10084-
return String(bucketIndex * 1e3);
10060+
const bucketIndex = Math.floor(number / 100);
10061+
return String(bucketIndex * 100);
1008510062
}
1008610063
/**
1008710064
* Send context pixel info when context is used
1008810065
* @param {Object} contextData - Context data object
1008910066
*/
10090-
sendContextPixelInfo(contextData) {
10091-
if (!contextData?.content) {
10067+
sendContextPixelInfo(contextData, pixelName) {
10068+
if (!contextData?.content || contextData.content.length === 0) {
1009210069
this.log.warn("sendContextPixelInfo: No content available for pixel tracking");
1009310070
return;
1009410071
}
10095-
this.sendPixel(_DuckAiPromptTelemetry.CONTEXT_PIXEL_NAME, {
10096-
contextLength: this.bucketSizeByThousands(contextData.content.length)
10072+
this.sendPixel(pixelName, {
10073+
contextLength: contextData.content.length
1009710074
});
1009810075
}
1009910076
/**
@@ -10118,14 +10095,15 @@ ${truncatedWarning}
1011810095
contextSize
1011910096
};
1012010097
if (contextData && contextSize > 0) {
10121-
this.sendContextPixelInfo(contextData);
10098+
this.sendContextPixelInfo(contextData, _DuckAiPromptTelemetry.CONTEXT_SEND_PIXEL_NAME);
1012210099
}
1012310100
this.checkShouldFireDailyTelemetry();
1012410101
this.storePromptTelemetry(promptData);
1012510102
}
1012610103
};
1012710104
__publicField(_DuckAiPromptTelemetry, "STORAGE_KEY", "aiChatPageContextTelemetry");
10128-
__publicField(_DuckAiPromptTelemetry, "CONTEXT_PIXEL_NAME", "dc_contextInfo");
10105+
__publicField(_DuckAiPromptTelemetry, "CONTEXT_ATTACH_PIXEL_NAME", "dc_contextInfoOnAttach");
10106+
__publicField(_DuckAiPromptTelemetry, "CONTEXT_SEND_PIXEL_NAME", "dc_contextInfoOnSubmit");
1012910107
__publicField(_DuckAiPromptTelemetry, "DAILY_PIXEL_NAME", "dc_pageContextDailyTelemetry");
1013010108
__publicField(_DuckAiPromptTelemetry, "ONE_DAY_MS", 24 * 60 * 60 * 1e3);
1013110109
var DuckAiPromptTelemetry = _DuckAiPromptTelemetry;

0 commit comments

Comments
 (0)