Skip to content

Commit e4afd8f

Browse files
Release build 4.23.0 [ci release]
1 parent 630eb2c commit e4afd8f

File tree

25 files changed

+839
-863
lines changed

25 files changed

+839
-863
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
"windowsInteropRemoveEventListener": "readonly"
1818
},
1919
"rules": {
20+
"no-restricted-syntax": [
21+
"error",
22+
{
23+
"selector": "MethodDefinition[key.type='PrivateIdentifier']",
24+
"message": "Private methods are currently unsupported in older WebKit and ESR Firefox"
25+
}
26+
],
2027
"indent": ["error", 4],
2128
"require-await": ["error"],
2229
"promise/prefer-await-to-then": ["error"],

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Collect commit ranges
4646
run: |
47-
echo "CHANGELOG=$(git log main --since "$(git show -s --format=%ci $(git rev-list --tags --max-count=1))" --pretty='format:- %s')" >> $GITHUB_OUTPUT
47+
echo "CHANGELOG=$(bash ./scripts/changelog.sh)" >> $GITHUB_OUTPUT
4848
4949
- name: Create Release
5050
uses: softprops/action-gh-release@v1

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,7 @@
911911
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
912912
/**
913913
* Test deep equality of two JSON values, objects, or arrays
914-
*/
915-
// TODO: write unit tests
914+
*/ // TODO: write unit tests
916915
function isEqual(a, b) {
917916
// FIXME: this function will return false for two objects with the same keys
918917
// but different order of keys

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@
495495
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
496496
/**
497497
* Test deep equality of two JSON values, objects, or arrays
498-
*/
499-
// TODO: write unit tests
498+
*/ // TODO: write unit tests
500499
function isEqual(a, b) {
501500
// FIXME: this function will return false for two objects with the same keys
502501
// but different order of keys

Sources/ContentScopeScripts/dist/pages/duckplayer/index.html

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -314,22 +314,15 @@
314314
<script>
315315
"use strict";
316316
(() => {
317-
var __defProp = Object.defineProperty;
318-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
319-
var __publicField = (obj, key, value) => {
320-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
321-
return value;
322-
};
323-
324317
// ../messaging/lib/windows.js
325318
var WindowsMessagingTransport = class {
319+
config;
326320
/**
327321
* @param {WindowsMessagingConfig} config
328322
* @param {import('../index.js').MessagingContext} messagingContext
329323
* @internal
330324
*/
331325
constructor(config, messagingContext) {
332-
__publicField(this, "config");
333326
this.messagingContext = messagingContext;
334327
this.config = config;
335328
this.globals = {
@@ -596,23 +589,15 @@
596589

597590
// ../messaging/lib/webkit.js
598591
var WebkitMessagingTransport = class {
592+
/** @type {WebkitMessagingConfig} */
593+
config;
594+
/** @internal */
595+
globals;
599596
/**
600597
* @param {WebkitMessagingConfig} config
601598
* @param {import('../index.js').MessagingContext} messagingContext
602599
*/
603600
constructor(config, messagingContext) {
604-
/** @type {WebkitMessagingConfig} */
605-
__publicField(this, "config");
606-
/** @internal */
607-
__publicField(this, "globals");
608-
/**
609-
* @type {{name: string, length: number}}
610-
* @internal
611-
*/
612-
__publicField(this, "algoObj", {
613-
name: "AES-GCM",
614-
length: 256
615-
});
616601
this.messagingContext = messagingContext;
617602
this.config = config;
618603
this.globals = captureGlobals();
@@ -745,6 +730,14 @@
745730
createRandMethodName() {
746731
return "_" + this.randomString();
747732
}
733+
/**
734+
* @type {{name: string, length: number}}
735+
* @internal
736+
*/
737+
algoObj = {
738+
name: "AES-GCM",
739+
length: 256
740+
};
748741
/**
749742
* @returns {Promise<Uint8Array>}
750743
* @internal
@@ -1151,7 +1144,7 @@
11511144
}
11521145

11531146
// ../../src/dom-utils.js
1154-
var Template = class {
1147+
var Template = class _Template {
11551148
constructor(strings, values) {
11561149
this.values = values;
11571150
this.strings = strings;
@@ -1179,7 +1172,7 @@
11791172
if (value instanceof Array) {
11801173
return value.map((val) => this.potentiallyEscape(val)).join("");
11811174
}
1182-
if (value instanceof Template) {
1175+
if (value instanceof _Template) {
11831176
return value;
11841177
}
11851178
throw new Error("Unknown object to escape");

Sources/ContentScopeScripts/dist/pages/duckplayer/js/index.js

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
"use strict";
22
(() => {
3-
var __defProp = Object.defineProperty;
4-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5-
var __publicField = (obj, key, value) => {
6-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7-
return value;
8-
};
9-
103
// ../messaging/lib/windows.js
114
var WindowsMessagingTransport = class {
5+
config;
126
/**
137
* @param {WindowsMessagingConfig} config
148
* @param {import('../index.js').MessagingContext} messagingContext
159
* @internal
1610
*/
1711
constructor(config, messagingContext) {
18-
__publicField(this, "config");
1912
this.messagingContext = messagingContext;
2013
this.config = config;
2114
this.globals = {
@@ -282,23 +275,15 @@
282275

283276
// ../messaging/lib/webkit.js
284277
var WebkitMessagingTransport = class {
278+
/** @type {WebkitMessagingConfig} */
279+
config;
280+
/** @internal */
281+
globals;
285282
/**
286283
* @param {WebkitMessagingConfig} config
287284
* @param {import('../index.js').MessagingContext} messagingContext
288285
*/
289286
constructor(config, messagingContext) {
290-
/** @type {WebkitMessagingConfig} */
291-
__publicField(this, "config");
292-
/** @internal */
293-
__publicField(this, "globals");
294-
/**
295-
* @type {{name: string, length: number}}
296-
* @internal
297-
*/
298-
__publicField(this, "algoObj", {
299-
name: "AES-GCM",
300-
length: 256
301-
});
302287
this.messagingContext = messagingContext;
303288
this.config = config;
304289
this.globals = captureGlobals();
@@ -431,6 +416,14 @@
431416
createRandMethodName() {
432417
return "_" + this.randomString();
433418
}
419+
/**
420+
* @type {{name: string, length: number}}
421+
* @internal
422+
*/
423+
algoObj = {
424+
name: "AES-GCM",
425+
length: 256
426+
};
434427
/**
435428
* @returns {Promise<Uint8Array>}
436429
* @internal
@@ -837,7 +830,7 @@
837830
}
838831

839832
// ../../src/dom-utils.js
840-
var Template = class {
833+
var Template = class _Template {
841834
constructor(strings, values) {
842835
this.values = values;
843836
this.strings = strings;
@@ -865,7 +858,7 @@
865858
if (value instanceof Array) {
866859
return value.map((val) => this.potentiallyEscape(val)).join("");
867860
}
868-
if (value instanceof Template) {
861+
if (value instanceof _Template) {
869862
return value;
870863
}
871864
throw new Error("Unknown object to escape");

build/android/contentScope.js

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,7 @@
928928
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
929929
/**
930930
* Test deep equality of two JSON values, objects, or arrays
931-
*/
932-
// TODO: write unit tests
931+
*/ // TODO: write unit tests
933932
function isEqual(a, b) {
934933
// FIXME: this function will return false for two objects with the same keys
935934
// but different order of keys
@@ -8645,12 +8644,12 @@
86458644
* Create the Facebook login button
86468645
* @type {HTMLDivElement}
86478646
*/
8648-
const loginButton = this.#createLoginButton();
8647+
const loginButton = this._createLoginButton();
86498648

86508649
/**
86518650
* Setup the click handlers
86528651
*/
8653-
this.#setupEventListeners(loginButton);
8652+
this._setupEventListeners(loginButton);
86548653

86558654
/**
86568655
* Append both to the shadow root
@@ -8679,10 +8678,10 @@
86798678
* proceed.
86808679
* @returns {HTMLDivElement}
86818680
*/
8682-
#createLoginButton () {
8681+
_createLoginButton () {
86838682
const { label, hoverText, logoIcon, learnMore } = this.params;
86848683

8685-
const { popoverStyle, arrowStyle } = this.#calculatePopoverPosition();
8684+
const { popoverStyle, arrowStyle } = this._calculatePopoverPosition();
86868685

86878686
const container = document.createElement('div');
86888687
// Add our own styles and inherit any local class styles on the button
@@ -8736,7 +8735,7 @@
87368735
* arrowStyle: string, // CSS styles to be applied in the Popover arrow
87378736
* }}
87388737
*/
8739-
#calculatePopoverPosition () {
8738+
_calculatePopoverPosition () {
87408739
const { originalElement } = this.params;
87418740
const rect = originalElement.getBoundingClientRect();
87428741
const textBubbleWidth = 360; // Should match the width rule in .ddg-popover
@@ -8770,7 +8769,7 @@
87708769
*
87718770
* @param {HTMLElement} loginButton
87728771
*/
8773-
#setupEventListeners (loginButton) {
8772+
_setupEventListeners (loginButton) {
87748773
const { originalElement, onClick } = this.params;
87758774

87768775
loginButton
@@ -9284,6 +9283,12 @@
92849283
// If this is a login button, show modal if needed
92859284
if (this.replaceSettings.type === 'loginButton' && entityData[this.entity].shouldShowLoginModal) {
92869285
return e => {
9286+
// Even if the user cancels the login attempt, consider Facebook Click to
9287+
// Load to have been active on the page if the user reports the page as broken.
9288+
if (this.entity === 'Facebook, Inc.') {
9289+
notifyFacebookLogin();
9290+
}
9291+
92879292
handleUnblockConfirmation(
92889293
this.platform.name, this.entity, handleClick, e
92899294
);
@@ -9437,6 +9442,7 @@
94379442

94389443
// Facebook
94399444
if (widget.replaceSettings.type === 'dialog') {
9445+
ctl.messaging.notify('updateFacebookCTLBreakageFlags', { ctlFacebookPlaceholderShown: true });
94409446
if (widget.shouldUseCustomElement()) {
94419447
/**
94429448
* Creates a custom HTML element with the placeholder element for blocked
@@ -9703,13 +9709,26 @@
97039709
}
97049710
}
97059711

9712+
/**
9713+
* Set the ctlFacebookLogin breakage flag for the page, to indicate that the
9714+
* Facebook Click to Load login flow had started if the user should then report
9715+
* the website as broken.
9716+
*/
9717+
function notifyFacebookLogin () {
9718+
ctl.messaging.notify('updateFacebookCTLBreakageFlags', { ctlFacebookLogin: true });
9719+
}
9720+
97069721
/**
97079722
* Unblock the entity, close the login dialog and continue the Facebook login
97089723
* flow. Called after the user clicks to proceed after the warning dialog is
97099724
* shown.
97109725
* @param {string} entity
97119726
*/
97129727
async function runLogin (entity) {
9728+
if (entity === 'Facebook, Inc.') {
9729+
notifyFacebookLogin();
9730+
}
9731+
97139732
const action = entity === 'Youtube' ? 'block-ctl-yt' : 'block-ctl-fb';
97149733
const response = await unblockClickToLoadContent({ entity, action, isLogin: true, isSurrogateLogin: true });
97159734
// If user rejected confirmation modal and content was not unblocked, inform surrogate and stop.
@@ -10626,6 +10645,12 @@
1062610645
}
1062710646
// Handle login call
1062810647
if (event.detail?.action === 'login') {
10648+
// Even if the user cancels the login attempt, consider Facebook Click to
10649+
// Load to have been active on the page if the user reports the page as broken.
10650+
if (entity === 'Facebook, Inc.') {
10651+
notifyFacebookLogin();
10652+
}
10653+
1062910654
if (entityData[entity].shouldShowLoginModal) {
1063010655
handleUnblockConfirmation(this.platform.name, entity, runLogin, entity);
1063110656
} else {
@@ -10904,7 +10929,8 @@
1090410929
'openShareFeedbackPage',
1090510930
'setYoutubePreviewsEnabled',
1090610931
'unblockClickToLoadContent',
10907-
'updateYouTubeCTLAddedFlag'
10932+
'updateYouTubeCTLAddedFlag',
10933+
'updateFacebookCTLBreakageFlags'
1090810934
];
1090910935

1091010936
function initCode () {

0 commit comments

Comments
 (0)