Skip to content

Commit 42f2eb3

Browse files
Release build 11.27.0 [ci release]
1 parent 28aa2f8 commit 42f2eb3

File tree

13 files changed

+194
-45
lines changed

13 files changed

+194
-45
lines changed

CHANGELOG.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
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)
1+
- Fire pixel on context send once and setup telemetry earlier (#1971)
2+
- Fix visual artifacting on macOS 26 in New Tab Page (#1972)
3+
- Add some basic docs for bundles and entry points (#1969)

build/apple/contentScope.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9058,9 +9058,9 @@ ul.messages {
90589058
}
90599059
async setup() {
90609060
this.createButtonUI();
9061+
this.setupTelemetry();
90619062
await this.setupMessageBridge();
90629063
this.setupTextBoxDetection();
9063-
this.setupTelemetry();
90649064
this.cleanupExistingPrompts();
90659065
this.setupPromptCleanupObserver();
90669066
}
@@ -9640,7 +9640,7 @@ ul.messages {
96409640
handleSendMessage() {
96419641
this.log.info("handleSendMessage called");
96429642
this.triggerInputEvents();
9643-
if (this.textBox && this.promptTelemetry) {
9643+
if (this.textBox && this.promptTelemetry && !this.hasContextBeenUsed) {
96449644
const rawPromptText = this.getRawPromptText();
96459645
const totalPromptText = this.textBox.value;
96469646
const contextSize = this.pageData?.content?.length || 0;
@@ -10043,10 +10043,12 @@ ${truncatedWarning}
1004310043
* @param {Object} params - Parameters to send with pixel
1004410044
*/
1004510045
sendPixel(pixelName, params) {
10046-
if (!globalThis?.DDG?.pixel) {
10046+
if (!globalThis?.DDG?.pixel?.fire) {
10047+
this.log.warn("sendPixel: No pixel object found");
1004710048
return;
1004810049
}
1004910050
globalThis.DDG.pixel.fire(pixelName, params);
10051+
this.log.info("Pixel sent", { pixelName, params });
1005010052
}
1005110053
/**
1005210054
* Bucket numbers by hundreds for privacy-friendly reporting
@@ -10063,14 +10065,15 @@ ${truncatedWarning}
1006310065
/**
1006410066
* Send context pixel info when context is used
1006510067
* @param {Object} contextData - Context data object
10068+
* @param {string} pixelName - Name of pixel to fire
1006610069
*/
1006710070
sendContextPixelInfo(contextData, pixelName) {
1006810071
if (!contextData?.content || contextData.content.length === 0) {
1006910072
this.log.warn("sendContextPixelInfo: No content available for pixel tracking");
1007010073
return;
1007110074
}
1007210075
this.sendPixel(pixelName, {
10073-
contextLength: contextData.content.length
10076+
contextLength: contextData.fullContentLength
1007410077
});
1007510078
}
1007610079
/**
@@ -10358,6 +10361,8 @@ ${children}
1035810361
metaDescription: this.getMetaDescription(),
1035910362
content: mainContent,
1036010363
truncated,
10364+
fullContentLength: this.fullContentLength,
10365+
// Include full content length before truncation
1036110366
headings: this.getHeadings(),
1036210367
links: this.getLinks(),
1036310368
images: this.getImages(),
@@ -10380,7 +10385,8 @@ ${children}
1038010385
return metaDesc ? metaDesc.getAttribute("content") || "" : "";
1038110386
}
1038210387
getMainContent() {
10383-
const maxLength = this.getFeatureSetting("maxContentLength") || 950;
10388+
const maxLength = this.getFeatureSetting("maxContentLength") || 9500;
10389+
const upperLimit = this.getFeatureSetting("upperLimit") || 5e5;
1038410390
let excludeSelectors = this.getFeatureSetting("excludeSelectors") || [".ad", ".sidebar", ".footer", ".nav", ".header"];
1038510391
excludeSelectors = excludeSelectors.concat(["script", "style", "link", "meta", "noscript", "svg", "canvas"]);
1038610392
let content = "";
@@ -10400,13 +10406,15 @@ ${children}
1040010406
elements.forEach((el) => el.remove());
1040110407
});
1040210408
this.log.info("Calling domToMarkdown", clone.innerHTML);
10403-
content += domToMarkdown(clone, maxLength);
10409+
content += domToMarkdown(clone, upperLimit);
1040410410
}
10411+
content = content.trim();
10412+
this.fullContentLength = content.length;
1040510413
if (content.length > maxLength) {
1040610414
this.log.info("Truncating content", content);
1040710415
content = content.substring(0, maxLength) + "...";
1040810416
}
10409-
return content.trim();
10417+
return content;
1041010418
}
1041110419
getHeadings() {
1041210420
const headings = [];

build/apple/pages/new-tab/dist/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ body {
154154
user-select: none;
155155
-webkit-user-select: none;
156156
cursor: default;
157+
-webkit-backdrop-filter: blur(0px);
158+
backdrop-filter: blur(0px);
157159
}
158160
:root[data-fatal-error] body {
159161
user-select: auto;

build/integration/contentScope.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14604,9 +14604,9 @@ ul.messages {
1460414604
}
1460514605
async setup() {
1460614606
this.createButtonUI();
14607+
this.setupTelemetry();
1460714608
await this.setupMessageBridge();
1460814609
this.setupTextBoxDetection();
14609-
this.setupTelemetry();
1461014610
this.cleanupExistingPrompts();
1461114611
this.setupPromptCleanupObserver();
1461214612
}
@@ -15186,7 +15186,7 @@ ul.messages {
1518615186
handleSendMessage() {
1518715187
this.log.info("handleSendMessage called");
1518815188
this.triggerInputEvents();
15189-
if (this.textBox && this.promptTelemetry) {
15189+
if (this.textBox && this.promptTelemetry && !this.hasContextBeenUsed) {
1519015190
const rawPromptText = this.getRawPromptText();
1519115191
const totalPromptText = this.textBox.value;
1519215192
const contextSize = this.pageData?.content?.length || 0;
@@ -15589,10 +15589,12 @@ ${truncatedWarning}
1558915589
* @param {Object} params - Parameters to send with pixel
1559015590
*/
1559115591
sendPixel(pixelName, params) {
15592-
if (!globalThis?.DDG?.pixel) {
15592+
if (!globalThis?.DDG?.pixel?.fire) {
15593+
this.log.warn("sendPixel: No pixel object found");
1559315594
return;
1559415595
}
1559515596
globalThis.DDG.pixel.fire(pixelName, params);
15597+
this.log.info("Pixel sent", { pixelName, params });
1559615598
}
1559715599
/**
1559815600
* Bucket numbers by hundreds for privacy-friendly reporting
@@ -15609,14 +15611,15 @@ ${truncatedWarning}
1560915611
/**
1561015612
* Send context pixel info when context is used
1561115613
* @param {Object} contextData - Context data object
15614+
* @param {string} pixelName - Name of pixel to fire
1561215615
*/
1561315616
sendContextPixelInfo(contextData, pixelName) {
1561415617
if (!contextData?.content || contextData.content.length === 0) {
1561515618
this.log.warn("sendContextPixelInfo: No content available for pixel tracking");
1561615619
return;
1561715620
}
1561815621
this.sendPixel(pixelName, {
15619-
contextLength: contextData.content.length
15622+
contextLength: contextData.fullContentLength
1562015623
});
1562115624
}
1562215625
/**
@@ -21677,6 +21680,8 @@ ${children}
2167721680
metaDescription: this.getMetaDescription(),
2167821681
content: mainContent,
2167921682
truncated,
21683+
fullContentLength: this.fullContentLength,
21684+
// Include full content length before truncation
2168021685
headings: this.getHeadings(),
2168121686
links: this.getLinks(),
2168221687
images: this.getImages(),
@@ -21699,7 +21704,8 @@ ${children}
2169921704
return metaDesc ? metaDesc.getAttribute("content") || "" : "";
2170021705
}
2170121706
getMainContent() {
21702-
const maxLength = this.getFeatureSetting("maxContentLength") || 950;
21707+
const maxLength = this.getFeatureSetting("maxContentLength") || 9500;
21708+
const upperLimit = this.getFeatureSetting("upperLimit") || 5e5;
2170321709
let excludeSelectors = this.getFeatureSetting("excludeSelectors") || [".ad", ".sidebar", ".footer", ".nav", ".header"];
2170421710
excludeSelectors = excludeSelectors.concat(["script", "style", "link", "meta", "noscript", "svg", "canvas"]);
2170521711
let content = "";
@@ -21719,13 +21725,15 @@ ${children}
2171921725
elements.forEach((el) => el.remove());
2172021726
});
2172121727
this.log.info("Calling domToMarkdown", clone.innerHTML);
21722-
content += domToMarkdown(clone, maxLength);
21728+
content += domToMarkdown(clone, upperLimit);
2172321729
}
21730+
content = content.trim();
21731+
this.fullContentLength = content.length;
2172421732
if (content.length > maxLength) {
2172521733
this.log.info("Truncating content", content);
2172621734
content = content.substring(0, maxLength) + "...";
2172721735
}
21728-
return content.trim();
21736+
return content;
2172921737
}
2173021738
getHeadings() {
2173121739
const headings = [];

build/integration/pages/new-tab/dist/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ body {
154154
user-select: none;
155155
-webkit-user-select: none;
156156
cursor: default;
157+
-webkit-backdrop-filter: blur(0px);
158+
backdrop-filter: blur(0px);
157159
}
158160
:root[data-fatal-error] body {
159161
user-select: auto;

build/windows/contentScope.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15789,6 +15789,8 @@ ${children}
1578915789
metaDescription: this.getMetaDescription(),
1579015790
content: mainContent,
1579115791
truncated,
15792+
fullContentLength: this.fullContentLength,
15793+
// Include full content length before truncation
1579215794
headings: this.getHeadings(),
1579315795
links: this.getLinks(),
1579415796
images: this.getImages(),
@@ -15811,7 +15813,8 @@ ${children}
1581115813
return metaDesc ? metaDesc.getAttribute("content") || "" : "";
1581215814
}
1581315815
getMainContent() {
15814-
const maxLength = this.getFeatureSetting("maxContentLength") || 950;
15816+
const maxLength = this.getFeatureSetting("maxContentLength") || 9500;
15817+
const upperLimit = this.getFeatureSetting("upperLimit") || 5e5;
1581515818
let excludeSelectors = this.getFeatureSetting("excludeSelectors") || [".ad", ".sidebar", ".footer", ".nav", ".header"];
1581615819
excludeSelectors = excludeSelectors.concat(["script", "style", "link", "meta", "noscript", "svg", "canvas"]);
1581715820
let content = "";
@@ -15831,13 +15834,15 @@ ${children}
1583115834
elements.forEach((el) => el.remove());
1583215835
});
1583315836
this.log.info("Calling domToMarkdown", clone.innerHTML);
15834-
content += domToMarkdown(clone, maxLength);
15837+
content += domToMarkdown(clone, upperLimit);
1583515838
}
15839+
content = content.trim();
15840+
this.fullContentLength = content.length;
1583615841
if (content.length > maxLength) {
1583715842
this.log.info("Truncating content", content);
1583815843
content = content.substring(0, maxLength) + "...";
1583915844
}
15840-
return content.trim();
15845+
return content;
1584115846
}
1584215847
getHeadings() {
1584315848
const headings = [];
@@ -15972,9 +15977,9 @@ ${children}
1597215977
}
1597315978
async setup() {
1597415979
this.createButtonUI();
15980+
this.setupTelemetry();
1597515981
await this.setupMessageBridge();
1597615982
this.setupTextBoxDetection();
15977-
this.setupTelemetry();
1597815983
this.cleanupExistingPrompts();
1597915984
this.setupPromptCleanupObserver();
1598015985
}
@@ -16554,7 +16559,7 @@ ${children}
1655416559
handleSendMessage() {
1655516560
this.log.info("handleSendMessage called");
1655616561
this.triggerInputEvents();
16557-
if (this.textBox && this.promptTelemetry) {
16562+
if (this.textBox && this.promptTelemetry && !this.hasContextBeenUsed) {
1655816563
const rawPromptText = this.getRawPromptText();
1655916564
const totalPromptText = this.textBox.value;
1656016565
const contextSize = this.pageData?.content?.length || 0;
@@ -16957,10 +16962,12 @@ ${truncatedWarning}
1695716962
* @param {Object} params - Parameters to send with pixel
1695816963
*/
1695916964
sendPixel(pixelName, params) {
16960-
if (!globalThis?.DDG?.pixel) {
16965+
if (!globalThis?.DDG?.pixel?.fire) {
16966+
this.log.warn("sendPixel: No pixel object found");
1696116967
return;
1696216968
}
1696316969
globalThis.DDG.pixel.fire(pixelName, params);
16970+
this.log.info("Pixel sent", { pixelName, params });
1696416971
}
1696516972
/**
1696616973
* Bucket numbers by hundreds for privacy-friendly reporting
@@ -16977,14 +16984,15 @@ ${truncatedWarning}
1697716984
/**
1697816985
* Send context pixel info when context is used
1697916986
* @param {Object} contextData - Context data object
16987+
* @param {string} pixelName - Name of pixel to fire
1698016988
*/
1698116989
sendContextPixelInfo(contextData, pixelName) {
1698216990
if (!contextData?.content || contextData.content.length === 0) {
1698316991
this.log.warn("sendContextPixelInfo: No content available for pixel tracking");
1698416992
return;
1698516993
}
1698616994
this.sendPixel(pixelName, {
16987-
contextLength: contextData.content.length
16995+
contextLength: contextData.fullContentLength
1698816996
});
1698916997
}
1699016998
/**

build/windows/pages/new-tab/dist/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ body {
154154
user-select: none;
155155
-webkit-user-select: none;
156156
cursor: default;
157+
-webkit-backdrop-filter: blur(0px);
158+
backdrop-filter: blur(0px);
157159
}
158160
:root[data-fatal-error] body {
159161
user-select: auto;

injected/docs/adding-bundles.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Adding a New Bundle
2+
3+
Bundles are how platforms integrate content-scope-scripts, they're often used within a context and so serve a distinct purpose. There is a cost to serving multiple bundles within the web page context so that should be avoided.
4+
5+
To add a new bundle to the Content Scope Scripts build system:
6+
7+
## 1. Define Build Configuration
8+
9+
**File**: `injected/scripts/entry-points.js`
10+
11+
Add your bundle to the `builds` object:
12+
13+
```js
14+
'my-new-bundle': {
15+
input: 'entry-points/my-entry.js',
16+
output: ['../build/my-platform/myScript.js'],
17+
},
18+
```
19+
20+
## 2. Update TypeScript Types
21+
22+
**File**: `injected/src/globals.d.ts`
23+
24+
Add the bundle name to the `injectName` union type:
25+
26+
```ts
27+
injectName?:
28+
| 'firefox'
29+
| 'apple'
30+
| 'my-new-bundle' // Add here
31+
```
32+
33+
## 3. Configure Platform Features (Optional)
34+
35+
**File**: `injected/src/features.js`
36+
37+
If creating a platform-specific bundle, add feature configuration:
38+
39+
```js
40+
'my-platform': [
41+
'cookie',
42+
...baseFeatures,
43+
'mySpecificFeature',
44+
],
45+
```
46+
47+
## Optional: 4. Create Entry Point
48+
49+
**Directory**: `injected/entry-points/`
50+
51+
Create your entry point file (e.g., `my-entry.js`) that imports and configures the required features for your bundle.
52+
53+
**Entry points** are the main files that define the implementation of a build. These should only be added if absolutely required.
54+
55+
## Remote configuration
56+
57+
Inject Name is a condition that can then be used in the config.
58+
59+
**Example**: Target specific bundles in feature configuration:
60+
61+
```json
62+
{
63+
"features": {
64+
"myFeature": {
65+
"state": "enabled",
66+
"settings": {
67+
"something": "hello",
68+
"conditionalChanges": [
69+
{
70+
"condition": {
71+
"injectName": "android-adsjs"
72+
},
73+
"patchSettings": [
74+
{
75+
"op": "replace",
76+
"path": "/something",
77+
"value": "else"
78+
}
79+
]
80+
}
81+
]
82+
}
83+
}
84+
}
85+
}
86+
```
87+
88+
This allows the same feature to have different behavior depending on which bundle it's running in.

0 commit comments

Comments
 (0)