Skip to content

Commit ba58674

Browse files
Release build 11.23.0 [ci release]
1 parent 9480fae commit ba58674

File tree

11 files changed

+440
-102
lines changed

11 files changed

+440
-102
lines changed

CHANGELOG.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- Fix shadow rendering issue in popover when mousing over Customize link (#1958)
2-
- NTP: Adjust omnibar background colour on dark gradient/color backgrounds (#1957)
1+
- Follow up page context redux (#1960)
2+
- [Google password import] autotap export button in modal (#1933)

build/android/autofillPasswordImport.js

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3811,13 +3811,14 @@
38113811
var BACKGROUND_COLOR_START = "rgba(85, 127, 243, 0.10)";
38123812
var BACKGROUND_COLOR_END = "rgba(85, 127, 243, 0.25)";
38133813
var OVERLAY_ID = "ddg-password-import-overlay";
3814-
var _exportButtonSettings, _settingsButtonSettings, _signInButtonSettings, _elementToCenterOn, _currentOverlay, _currentElementConfig, _domLoaded, _tappedElements;
3814+
var _exportButtonSettings, _settingsButtonSettings, _signInButtonSettings, _exportConfirmButtonSettings, _elementToCenterOn, _currentOverlay, _currentElementConfig, _domLoaded, _tappedElements;
38153815
var AutofillPasswordImport = class extends ContentFeature {
38163816
constructor() {
38173817
super(...arguments);
38183818
__privateAdd(this, _exportButtonSettings);
38193819
__privateAdd(this, _settingsButtonSettings);
38203820
__privateAdd(this, _signInButtonSettings);
3821+
__privateAdd(this, _exportConfirmButtonSettings);
38213822
/** @type {HTMLElement|Element|SVGElement|null} */
38223823
__privateAdd(this, _elementToCenterOn);
38233824
/** @type {HTMLElement|null} */
@@ -3897,6 +3898,43 @@
38973898
get domLoaded() {
38983899
return __privateGet(this, _domLoaded);
38993900
}
3901+
/**
3902+
* @returns {Promise<Element|HTMLElement|null>}
3903+
*/
3904+
async runWithRetry(fn) {
3905+
try {
3906+
return await withExponentialBackoff(fn);
3907+
} catch {
3908+
return null;
3909+
}
3910+
}
3911+
/**
3912+
* @returns {Promise<ElementConfig | null>}
3913+
*/
3914+
async getExportConfirmElementAndStyle() {
3915+
const exportConfirmElement = await this.findExportConfirmElement();
3916+
const shouldAutotap = __privateGet(this, _exportConfirmButtonSettings)?.shouldAutotap && exportConfirmElement != null;
3917+
return shouldAutotap ? {
3918+
animationStyle: null,
3919+
element: exportConfirmElement,
3920+
shouldTap: true,
3921+
shouldWatchForRemoval: false,
3922+
tapOnce: false
3923+
} : null;
3924+
}
3925+
/**
3926+
* @returns {Promise<ElementConfig | null>}
3927+
*/
3928+
async getExportElementAndStyle() {
3929+
const element = await this.findExportElement();
3930+
return element != null ? {
3931+
animationStyle: this.exportButtonAnimationStyle,
3932+
element,
3933+
shouldTap: __privateGet(this, _exportButtonSettings)?.shouldAutotap ?? false,
3934+
shouldWatchForRemoval: true,
3935+
tapOnce: true
3936+
} : null;
3937+
}
39003938
/**
39013939
* Takes a path and returns the element and style to animate.
39023940
* @param {string} path
@@ -3913,14 +3951,12 @@
39133951
tapOnce: false
39143952
} : null;
39153953
} else if (path === "/options") {
3916-
const element = await this.findExportElement();
3917-
return element != null ? {
3918-
animationStyle: this.exportButtonAnimationStyle,
3919-
element,
3920-
shouldTap: __privateGet(this, _exportButtonSettings)?.shouldAutotap ?? false,
3921-
shouldWatchForRemoval: true,
3922-
tapOnce: true
3923-
} : null;
3954+
const isExportButtonTapped = this.currentElementConfig?.element != null && __privateGet(this, _tappedElements).has(this.currentElementConfig?.element);
3955+
if (isExportButtonTapped) {
3956+
return await this.getExportConfirmElementAndStyle();
3957+
} else {
3958+
return await this.getExportElementAndStyle();
3959+
}
39243960
} else if (path === "/intro") {
39253961
const element = await this.findSignInButton();
39263962
return element != null ? {
@@ -4072,6 +4108,9 @@
40724108
autotapElement(element) {
40734109
element.click();
40744110
}
4111+
async findExportConfirmElement() {
4112+
return await this.runWithRetry(() => document.querySelector(this.exportConfirmButtonSelector));
4113+
}
40754114
/**
40764115
* On passwords.google.com the export button is in a container that is quite ambiguious.
40774116
* To solve for that we first try to find the container and then the button inside it.
@@ -4086,7 +4125,7 @@
40864125
const findWithLabel = () => {
40874126
return document.querySelector(this.exportButtonLabelTextSelector);
40884127
};
4089-
return await withExponentialBackoff(() => findInContainer() ?? findWithLabel());
4128+
return await this.runWithRetry(() => findInContainer() ?? findWithLabel());
40904129
}
40914130
/**
40924131
* @returns {Promise<HTMLElement|Element|null>}
@@ -4096,13 +4135,13 @@
40964135
const settingsButton = document.querySelector(this.settingsButtonSelector);
40974136
return settingsButton;
40984137
};
4099-
return await withExponentialBackoff(fn);
4138+
return await this.runWithRetry(fn);
41004139
}
41014140
/**
41024141
* @returns {Promise<HTMLElement|Element|null>}
41034142
*/
41044143
async findSignInButton() {
4105-
return await withExponentialBackoff(() => document.querySelector(this.signinButtonSelector));
4144+
return await this.runWithRetry(() => document.querySelector(this.signinButtonSelector));
41064145
}
41074146
/**
41084147
* @param {Event} event
@@ -4118,7 +4157,7 @@
41184157
setCurrentElementConfig(config) {
41194158
if (config != null) {
41204159
__privateSet(this, _currentElementConfig, config);
4121-
this.setElementToCenterOn(config.element, config.animationStyle);
4160+
if (config.animationStyle != null) this.setElementToCenterOn(config.element, config.animationStyle);
41224161
}
41234162
}
41244163
/**
@@ -4127,7 +4166,12 @@
41274166
* @returns {boolean}
41284167
*/
41294168
isSupportedPath(path) {
4130-
return [__privateGet(this, _exportButtonSettings)?.path, __privateGet(this, _settingsButtonSettings)?.path, __privateGet(this, _signInButtonSettings)?.path].includes(path);
4169+
return [
4170+
__privateGet(this, _exportButtonSettings)?.path,
4171+
__privateGet(this, _settingsButtonSettings)?.path,
4172+
__privateGet(this, _signInButtonSettings)?.path,
4173+
__privateGet(this, _exportConfirmButtonSettings)?.path
4174+
].includes(path);
41314175
}
41324176
async handlePath(path) {
41334177
this.removeOverlayIfNeeded();
@@ -4151,12 +4195,14 @@
41514195
*/
41524196
async animateOrTapElement() {
41534197
const { element, animationStyle, shouldTap, shouldWatchForRemoval } = this.currentElementConfig ?? {};
4154-
if (element != null && animationStyle != null) {
4198+
if (element != null) {
41554199
if (shouldTap) {
41564200
this.autotapElement(element);
41574201
} else {
4158-
await this.domLoaded;
4159-
this.animateElement(element, animationStyle);
4202+
if (animationStyle != null) {
4203+
await this.domLoaded;
4204+
this.animateElement(element, animationStyle);
4205+
}
41604206
}
41614207
if (shouldWatchForRemoval) {
41624208
this.observeElementRemoval(element, () => {
@@ -4171,6 +4217,12 @@
41714217
get exportButtonContainerSelector() {
41724218
return __privateGet(this, _exportButtonSettings)?.selectors?.join(",");
41734219
}
4220+
/**
4221+
* @returns {string}
4222+
*/
4223+
get exportConfirmButtonSelector() {
4224+
return __privateGet(this, _exportConfirmButtonSettings)?.selectors?.join(",");
4225+
}
41744226
/**
41754227
* @returns {string}
41764228
*/
@@ -4205,6 +4257,7 @@
42054257
__privateSet(this, _exportButtonSettings, this.getFeatureSetting("exportButton"));
42064258
__privateSet(this, _signInButtonSettings, this.getFeatureSetting("signInButton"));
42074259
__privateSet(this, _settingsButtonSettings, this.getFeatureSetting("settingsButton"));
4260+
__privateSet(this, _exportConfirmButtonSettings, this.getFeatureSetting("exportConfirmButton"));
42084261
}
42094262
urlChanged() {
42104263
this.handlePath(window.location.pathname);
@@ -4235,6 +4288,7 @@
42354288
_exportButtonSettings = new WeakMap();
42364289
_settingsButtonSettings = new WeakMap();
42374290
_signInButtonSettings = new WeakMap();
4291+
_exportConfirmButtonSettings = new WeakMap();
42384292
_elementToCenterOn = new WeakMap();
42394293
_currentOverlay = new WeakMap();
42404294
_currentElementConfig = new WeakMap();

build/apple/contentScope.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,6 +9692,12 @@ ul.messages {
96929692
const match = text.match(promptRegex);
96939693
if (match) {
96949694
const extractedPrompt = match[2].trim();
9695+
if (!this.hasContextBeenUsed) {
9696+
this.hasContextBeenUsed = true;
9697+
this.removeContextChip();
9698+
this.updateButtonAppearance();
9699+
this.log.info("Context marked as used based on prompt cleanup");
9700+
}
96959701
let cleanedContent = "";
96969702
if (extractedPrompt) {
96979703
cleanedContent = `${extractedPrompt}
@@ -9781,7 +9787,7 @@ ul.messages {
97819787
const callback = (_2, observer) => {
97829788
this.findTextBox();
97839789
this.setupMessageInterception();
9784-
if (this.textBox && this.pageData && this.sendButton) {
9790+
if (this.textBox && this.pageData && this.sendButton && !this.hasContextBeenUsed) {
97859791
this.createContextChip();
97869792
observer.disconnect();
97879793
}
@@ -10202,9 +10208,12 @@ ${children}
1020210208
return children;
1020310209
}
1020410210
}
10211+
function collapseAndTrim(str) {
10212+
return collapseWhitespace(str).trim();
10213+
}
1020510214
function getLinkText(node) {
1020610215
const href = node.getAttribute("href");
10207-
return href ? `[${node.textContent}](${href})` : node.textContent;
10216+
return href ? `[${collapseAndTrim(node.textContent)}](${href})` : collapseWhitespace(node.textContent);
1020810217
}
1020910218
var _cachedContent, _cachedTimestamp;
1021010219
var PageContext = class extends ContentFeature {

0 commit comments

Comments
 (0)