From 767bfa21ebd012b5541e46c67c42ed5f964f50d3 Mon Sep 17 00:00:00 2001 From: Dax Mobile <44842493+daxmobile@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:27:21 +1100 Subject: [PATCH] Update content scope scripts to version 7.18.0 (#5642) Task/Issue URL: https://app.asana.com/0/488551667048375/1209394211370089/f ----- - Automated content scope scripts dependency update This PR updates the content scope scripts dependency to the latest available version and copies the necessary files. If tests have failed, see https://app.asana.com/0/1202561462274611/1203986899650836/f for further information on what to do next. - [ ] All tests must pass Co-authored-by: daxmobile --- .../build/android/autofillPasswordImport.js | 17 ++++++++++++++++- package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/node_modules/@duckduckgo/content-scope-scripts/build/android/autofillPasswordImport.js b/node_modules/@duckduckgo/content-scope-scripts/build/android/autofillPasswordImport.js index 128dd42ffb6e..5f64d6e7362a 100644 --- a/node_modules/@duckduckgo/content-scope-scripts/build/android/autofillPasswordImport.js +++ b/node_modules/@duckduckgo/content-scope-scripts/build/android/autofillPasswordImport.js @@ -3506,6 +3506,7 @@ * @property {ButtonAnimationStyle} animationStyle * @property {boolean} shouldTap * @property {boolean} shouldWatchForRemoval + * @property {boolean} tapOnce */ /** @@ -3533,6 +3534,9 @@ #domLoaded; + /** @type {WeakSet} */ + #tappedElements = new WeakSet(); + /** * @returns {ButtonAnimationStyle} */ @@ -3623,6 +3627,7 @@ element, shouldTap: this.#settingsButtonSettings?.shouldAutotap ?? false, shouldWatchForRemoval: false, + tapOnce: false, } : null; } else if (path === '/options') { @@ -3633,6 +3638,7 @@ element, shouldTap: this.#exportButtonSettings?.shouldAutotap ?? false, shouldWatchForRemoval: true, + tapOnce: true, } : null; } else if (path === '/intro') { @@ -3643,6 +3649,7 @@ element, shouldTap: this.#signInButtonSettings?.shouldAutotap ?? false, shouldWatchForRemoval: false, + tapOnce: false, } : null; } else { @@ -3659,6 +3666,9 @@ this.currentOverlay.remove(); this.currentOverlay = null; document.removeEventListener('scroll', this); + if (this.currentElementConfig?.element) { + this.#tappedElements.delete(this.currentElementConfig?.element); + } } } @@ -3881,7 +3891,12 @@ if (this.isSupportedPath(path)) { try { this.setCurrentElementConfig(await this.getElementAndStyleFromPath(path)); - await this.animateOrTapElement(); + if (this.currentElementConfig?.element && !this.#tappedElements.has(this.currentElementConfig?.element)) { + await this.animateOrTapElement(); + if (this.currentElementConfig?.shouldTap && this.currentElementConfig?.tapOnce) { + this.#tappedElements.add(this.currentElementConfig.element); + } + } } catch { console.error('password-import: failed for path:', path); } diff --git a/package-lock.json b/package-lock.json index c99c0a164bdc..9abcf7d6a9fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "version": "1.0.0", "dependencies": { "@duckduckgo/autoconsent": "^12.9.0", - "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#8.4.0", "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#16.2.1", - "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#7.17.0", + "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#7.18.0", + "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#8.4.0", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#1738159777" }, "devDependencies": { "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": gt "^13.0.6", + "@rollup/plugin-node-resolve": "^13.0.6", "rollup": "^2.61.0", "rollup-plugin-terser": "^7.0.2" } @@ -63,7 +63,7 @@ "license": "Apache-2.0" }, "node_modules/@duckduckgo/content-scope-scripts": { - "resolved": "git+ssh://git@github.com/duckduckgo/content-scope-scripts.git#1876d68142cf4f9abfaaee235a015d287eb71226", + "resolved": "git+ssh://git@github.com/duckduckgo/content-scope-scripts.git#874b27ad51d1784c934760c85493f78e609c4409", "license": "Apache-2.0", "workspaces": [ "injected", @@ -651,9 +651,9 @@ } }, "node_modules/terser": { - "version": "5.38.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.38.1.tgz", - "integrity": "sha512-GWANVlPM/ZfYzuPHjq0nxT+EbOEDDN3Jwhwdg1D8TU8oSkktp8w64Uq4auuGLxFSoNTRDncTq2hQHX1Ld9KHkA==", + "version": "5.38.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.38.2.tgz", + "integrity": "sha512-w8CXxxbFA5zfNsR/i8HZq5bvn18AK0O9jj7hyo1YqkovLxEFa0uP0LCVGZRqiRaKRFxXhELBp8SteeAjEnfeJg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/package.json b/package.json index f43041bb655f..41a6233c17ce 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dependencies": { "@duckduckgo/autoconsent": "^12.9.0", "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#16.2.1", - "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#7.17.0", + "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#7.18.0", "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#8.4.0", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#1738159777" }