diff --git a/node_modules/@duckduckgo/autofill/dist/autofill-debug.js b/node_modules/@duckduckgo/autofill/dist/autofill-debug.js index a7d8a884b2e7..9670360cda10 100644 --- a/node_modules/@duckduckgo/autofill/dist/autofill-debug.js +++ b/node_modules/@duckduckgo/autofill/dist/autofill-debug.js @@ -8829,18 +8829,21 @@ class InterfacePrototype { * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress && 'emailAddress' in data && data.emailAddress) { + if (isPrivateAddress) { this.refreshAlias(); - this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ - const formValues = { - credentials: { - username: data.emailAddress, - autogenerated: true - } - }; - this.storeFormData(formValues, 'emailProtection'); + if ('emailAddress' in data && data.emailAddress) { + this.emailProtection.storeReceived(data.emailAddress); + /** @type {DataStorageObject} */ + + const formValues = { + credentials: { + username: data.emailAddress, + autogenerated: true + } + }; + this.storeFormData(formValues, 'emailProtection'); + } } await this.removeTooltip(); @@ -8987,8 +8990,11 @@ class InterfacePrototype { case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { + const autogeneratedPayload = { ...matchingData, + username: '' + }; return Promise.resolve({ - success: matchingData + success: autogeneratedPayload }); } @@ -10950,7 +10956,7 @@ var _autofillUtils = require("../autofill-utils.js"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -const loginRegex = new RegExp(/sign(ing)?.?in(?!g)|log.?(i|o)n|log.?out|unsubscri|(forgot(ten)?|reset) (your )?password|password (forgotten|lost)|unlock|logged in as/i); +const loginRegex = new RegExp(/sign(ing)?.?in(?!g)|log.?(i|o)n|log.?out|unsubscri|(forgot(ten)?|reset) (your )?password|password (forgotten|lost)|unlock|logged in as|mfa-submit-form/i); const signupRegex = new RegExp(/sign(ing)?.?up|join|\bregist(er|ration)|newsletter|\bsubscri(be|ption)|contact|create|start|enroll|settings|preferences|profile|update|checkout|guest|purchase|buy|order|schedule|estimate|request|new.?customer|(confirm|retype|repeat) password|password confirm?/i); const conservativeSignupRegex = new RegExp(/sign.?up|join|register|enroll|newsletter|subscri(be|ption)|settings|preferences|profile|update/i); const strictSignupRegex = new RegExp(/sign.?up|join|register|(create|new).+account|enroll|settings|preferences|profile|update/i); @@ -14500,7 +14506,8 @@ const username = ["".concat(GENERIC_TEXT_FIELD, "[autocomplete^=user i]"), "inpu "input[name=\"masterid\" i]", // https://giris.turkiye.gov.tr "input[name=\"tridField\" i]", // https://membernetprb2c.b2clogin.com "input[id=\"signInName\" i]", // https://www.w3.org/accounts/request -"input[id=\"w3c_accountsbundle_accountrequeststep1_login\" i]", "input[id=\"username\" i]", "input[name=\"_user\" i]", "input[name=\"login_username\" i]", "input[placeholder^=\"username\" i]"]; // todo: these are still used directly right now, mostly in scanForInputs +"input[id=\"w3c_accountsbundle_accountrequeststep1_login\" i]", "input[id=\"username\" i]", "input[name=\"_user\" i]", "input[name=\"login_username\" i]", // https://www.flytap.com/ +"input[name^=\"login-user-account\" i]", "input[placeholder^=\"username\" i]"]; // todo: these are still used directly right now, mostly in scanForInputs // todo: ensure these can be set via configuration // Exported here for now, to be moved to configuration later @@ -15174,6 +15181,8 @@ var _matching = require("./Form/matching.js"); var _autofillUtils = require("./autofill-utils.js"); +var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } const { @@ -15303,6 +15312,12 @@ class DefaultScanner { init() { + if (this.device.globalConfig.isExtension) { + this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ + flag: 'autofill' + })); + } + const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { @@ -15516,7 +15531,7 @@ function createScanner(device, scannerOptions) { }); } -},{"./Form/Form.js":33,"./Form/matching.js":43,"./Form/selectors-css.js":44,"./autofill-utils.js":63,"./constants.js":66}],52:[function(require,module,exports){ +},{"./Form/Form.js":33,"./Form/matching.js":43,"./Form/selectors-css.js":44,"./autofill-utils.js":63,"./constants.js":66,"./deviceApiCalls/__generated__/deviceApiCalls.js":67}],52:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -16521,7 +16536,7 @@ class HTMLTooltip { const handler = this.clickableButtons.get(this.activeButton); if (handler) { - if (this.activeButton.matches('.wrapper:not(.top-autofill) *:hover, .currentFocus')) { + if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { checkVisibility: this.options.checkVisibility }); @@ -18027,19 +18042,16 @@ const SUBMIT_BUTTON_UNLIKELY_REGEX = /facebook|twitter|google|apple|cancel|passw */ const isLikelyASubmitButton = el => { - const text = el.textContent || ''; + const text = getText(el); const ariaLabel = el.getAttribute('aria-label') || ''; - const title = el.title || ''; - const value = el instanceof HTMLInputElement ? el.value || '' : ''; const dataTestId = el.getAttribute('data-test-id') || ''; - const contentExcludingLabel = text + ' ' + title + ' ' + value; return (el.getAttribute('type') === 'submit' || // is explicitly set as "submit" el.getAttribute('name') === 'submit' || // is called "submit" /primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || SUBMIT_BUTTON_REGEX.test(contentExcludingLabel) || // has high-signal text + /submit/i.test(dataTestId) || SUBMIT_BUTTON_REGEX.test(text) || // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !SUBMIT_BUTTON_UNLIKELY_REGEX.test(contentExcludingLabel + ' ' + ariaLabel); + !SUBMIT_BUTTON_UNLIKELY_REGEX.test(text + ' ' + ariaLabel); }; /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form @@ -18075,7 +18087,7 @@ const getText = el => { if (el instanceof HTMLInputElement && ['submit', 'button'].includes(el.type)) return el.value; if (el instanceof HTMLInputElement && el.type === 'image') { - return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title); + return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } return (0, _matching.removeExcessWhitespace)(Array.from(el.childNodes).reduce((text, child) => child instanceof Text ? text + ' ' + child.textContent : text, '')); @@ -18347,7 +18359,7 @@ exports.constants = constants; Object.defineProperty(exports, "__esModule", { value: true }); -exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = void 0; +exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; var _validatorsZod = require("./validators.zod.js"); @@ -18355,9 +18367,26 @@ var _deviceApi = require("../../../packages/device-api"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @extends {DeviceApiCall} + */ +class AddDebugFlagCall extends _deviceApi.DeviceApiCall { + constructor() { + super(...arguments); + + _defineProperty(this, "method", "addDebugFlag"); + + _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); + } + +} /** * @extends {DeviceApiCall} */ + + +exports.AddDebugFlagCall = AddDebugFlagCall; + class GetAutofillDataCall extends _deviceApi.DeviceApiCall { constructor() { super(...arguments); @@ -18820,7 +18849,7 @@ exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; Object.defineProperty(exports, "__esModule", { value: true }); -exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = void 0; +exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; var _zod = require("zod"); @@ -18849,6 +18878,12 @@ const sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; +const addDebugFlagParamsSchema = _zod.z.object({ + flag: _zod.z.string() +}); + +exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; + const generatedPasswordSchema = _zod.z.object({ value: _zod.z.string(), username: _zod.z.string() @@ -19217,6 +19252,9 @@ const askToUnlockProviderResultSchema = _zod.z.object({ exports.askToUnlockProviderResultSchema = askToUnlockProviderResultSchema; const apiSchema = _zod.z.object({ + addDebugFlag: _zod.z.record(_zod.z.unknown()).and(_zod.z.object({ + paramsValidator: addDebugFlagParamsSchema.optional() + })).optional(), getAutofillData: _zod.z.record(_zod.z.unknown()).and(_zod.z.object({ id: _zod.z.literal("getAutofillDataResponse").optional(), paramsValidator: getAutofillDataRequestSchema.optional(), @@ -19630,6 +19668,10 @@ class ExtensionTransport extends _index.DeviceApiTransport { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } + if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { + return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); + } + if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } @@ -19712,6 +19754,21 @@ async function extensionSpecificSendPixel(params) { }); }); } +/** + * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params + */ + + +async function extensionSpecificAddDebugFlag(params) { + return new Promise(resolve => { + chrome.runtime.sendMessage({ + messageType: 'addDebugFlag', + options: params + }, () => { + resolve(true); + }); + }); +} async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { diff --git a/node_modules/@duckduckgo/autofill/dist/autofill.js b/node_modules/@duckduckgo/autofill/dist/autofill.js index 6e591440e2ad..743940a67efd 100644 --- a/node_modules/@duckduckgo/autofill/dist/autofill.js +++ b/node_modules/@duckduckgo/autofill/dist/autofill.js @@ -5153,18 +5153,21 @@ class InterfacePrototype { * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress && 'emailAddress' in data && data.emailAddress) { + if (isPrivateAddress) { this.refreshAlias(); - this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ - const formValues = { - credentials: { - username: data.emailAddress, - autogenerated: true - } - }; - this.storeFormData(formValues, 'emailProtection'); + if ('emailAddress' in data && data.emailAddress) { + this.emailProtection.storeReceived(data.emailAddress); + /** @type {DataStorageObject} */ + + const formValues = { + credentials: { + username: data.emailAddress, + autogenerated: true + } + }; + this.storeFormData(formValues, 'emailProtection'); + } } await this.removeTooltip(); @@ -5311,8 +5314,11 @@ class InterfacePrototype { case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { + const autogeneratedPayload = { ...matchingData, + username: '' + }; return Promise.resolve({ - success: matchingData + success: autogeneratedPayload }); } @@ -7274,7 +7280,7 @@ var _autofillUtils = require("../autofill-utils.js"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -const loginRegex = new RegExp(/sign(ing)?.?in(?!g)|log.?(i|o)n|log.?out|unsubscri|(forgot(ten)?|reset) (your )?password|password (forgotten|lost)|unlock|logged in as/i); +const loginRegex = new RegExp(/sign(ing)?.?in(?!g)|log.?(i|o)n|log.?out|unsubscri|(forgot(ten)?|reset) (your )?password|password (forgotten|lost)|unlock|logged in as|mfa-submit-form/i); const signupRegex = new RegExp(/sign(ing)?.?up|join|\bregist(er|ration)|newsletter|\bsubscri(be|ption)|contact|create|start|enroll|settings|preferences|profile|update|checkout|guest|purchase|buy|order|schedule|estimate|request|new.?customer|(confirm|retype|repeat) password|password confirm?/i); const conservativeSignupRegex = new RegExp(/sign.?up|join|register|enroll|newsletter|subscri(be|ption)|settings|preferences|profile|update/i); const strictSignupRegex = new RegExp(/sign.?up|join|register|(create|new).+account|enroll|settings|preferences|profile|update/i); @@ -10824,7 +10830,8 @@ const username = ["".concat(GENERIC_TEXT_FIELD, "[autocomplete^=user i]"), "inpu "input[name=\"masterid\" i]", // https://giris.turkiye.gov.tr "input[name=\"tridField\" i]", // https://membernetprb2c.b2clogin.com "input[id=\"signInName\" i]", // https://www.w3.org/accounts/request -"input[id=\"w3c_accountsbundle_accountrequeststep1_login\" i]", "input[id=\"username\" i]", "input[name=\"_user\" i]", "input[name=\"login_username\" i]", "input[placeholder^=\"username\" i]"]; // todo: these are still used directly right now, mostly in scanForInputs +"input[id=\"w3c_accountsbundle_accountrequeststep1_login\" i]", "input[id=\"username\" i]", "input[name=\"_user\" i]", "input[name=\"login_username\" i]", // https://www.flytap.com/ +"input[name^=\"login-user-account\" i]", "input[placeholder^=\"username\" i]"]; // todo: these are still used directly right now, mostly in scanForInputs // todo: ensure these can be set via configuration // Exported here for now, to be moved to configuration later @@ -11498,6 +11505,8 @@ var _matching = require("./Form/matching.js"); var _autofillUtils = require("./autofill-utils.js"); +var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } const { @@ -11627,6 +11636,12 @@ class DefaultScanner { init() { + if (this.device.globalConfig.isExtension) { + this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ + flag: 'autofill' + })); + } + const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { @@ -11840,7 +11855,7 @@ function createScanner(device, scannerOptions) { }); } -},{"./Form/Form.js":25,"./Form/matching.js":35,"./Form/selectors-css.js":36,"./autofill-utils.js":55,"./constants.js":58}],44:[function(require,module,exports){ +},{"./Form/Form.js":25,"./Form/matching.js":35,"./Form/selectors-css.js":36,"./autofill-utils.js":55,"./constants.js":58,"./deviceApiCalls/__generated__/deviceApiCalls.js":59}],44:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -12845,7 +12860,7 @@ class HTMLTooltip { const handler = this.clickableButtons.get(this.activeButton); if (handler) { - if (this.activeButton.matches('.wrapper:not(.top-autofill) *:hover, .currentFocus')) { + if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { checkVisibility: this.options.checkVisibility }); @@ -14351,19 +14366,16 @@ const SUBMIT_BUTTON_UNLIKELY_REGEX = /facebook|twitter|google|apple|cancel|passw */ const isLikelyASubmitButton = el => { - const text = el.textContent || ''; + const text = getText(el); const ariaLabel = el.getAttribute('aria-label') || ''; - const title = el.title || ''; - const value = el instanceof HTMLInputElement ? el.value || '' : ''; const dataTestId = el.getAttribute('data-test-id') || ''; - const contentExcludingLabel = text + ' ' + title + ' ' + value; return (el.getAttribute('type') === 'submit' || // is explicitly set as "submit" el.getAttribute('name') === 'submit' || // is called "submit" /primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || SUBMIT_BUTTON_REGEX.test(contentExcludingLabel) || // has high-signal text + /submit/i.test(dataTestId) || SUBMIT_BUTTON_REGEX.test(text) || // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !SUBMIT_BUTTON_UNLIKELY_REGEX.test(contentExcludingLabel + ' ' + ariaLabel); + !SUBMIT_BUTTON_UNLIKELY_REGEX.test(text + ' ' + ariaLabel); }; /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form @@ -14399,7 +14411,7 @@ const getText = el => { if (el instanceof HTMLInputElement && ['submit', 'button'].includes(el.type)) return el.value; if (el instanceof HTMLInputElement && el.type === 'image') { - return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title); + return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } return (0, _matching.removeExcessWhitespace)(Array.from(el.childNodes).reduce((text, child) => child instanceof Text ? text + ' ' + child.textContent : text, '')); @@ -14671,7 +14683,7 @@ exports.constants = constants; Object.defineProperty(exports, "__esModule", { value: true }); -exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = void 0; +exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; var _validatorsZod = require("./validators.zod.js"); @@ -14679,9 +14691,26 @@ var _deviceApi = require("../../../packages/device-api"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @extends {DeviceApiCall} + */ +class AddDebugFlagCall extends _deviceApi.DeviceApiCall { + constructor() { + super(...arguments); + + _defineProperty(this, "method", "addDebugFlag"); + + _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); + } + +} /** * @extends {DeviceApiCall} */ + + +exports.AddDebugFlagCall = AddDebugFlagCall; + class GetAutofillDataCall extends _deviceApi.DeviceApiCall { constructor() { super(...arguments); @@ -15144,9 +15173,11 @@ exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; Object.defineProperty(exports, "__esModule", { value: true }); -exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = void 0; +exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; const sendJSPixelParamsSchema = null; exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; +const addDebugFlagParamsSchema = null; +exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; const generatedPasswordSchema = null; exports.generatedPasswordSchema = generatedPasswordSchema; const triggerContextSchema = null; @@ -15540,6 +15571,10 @@ class ExtensionTransport extends _index.DeviceApiTransport { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } + if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { + return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); + } + if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } @@ -15622,6 +15657,21 @@ async function extensionSpecificSendPixel(params) { }); }); } +/** + * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params + */ + + +async function extensionSpecificAddDebugFlag(params) { + return new Promise(resolve => { + chrome.runtime.sendMessage({ + messageType: 'addDebugFlag', + options: params + }, () => { + resolve(true); + }); + }); +} async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { diff --git a/package-lock.json b/package-lock.json index 228216f5faa3..dcc77b0d4596 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@duckduckgo/autoconsent": "^5.1.0", - "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#8.1.1", + "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#8.1.2", "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#4.32.0", "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#1.4.0", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#1689964986" @@ -64,7 +64,7 @@ "integrity": "sha512-/ZUdNt+FLhtT40f53Pl/TwOLX1Rr4vCyzgDXQjtXBHF7vSaQJLRdkDkiEm4P24HAxNbg+WGeleJUiIEyQgfp2A==" }, "node_modules/@duckduckgo/autofill": { - "resolved": "git+ssh://git@github.com/duckduckgo/duckduckgo-autofill.git#56f1a4e8879888d05331c5749f49a7b6aa9c6a1d", + "resolved": "git+ssh://git@github.com/duckduckgo/duckduckgo-autofill.git#40bcd0d347b51d14e8114f191df2817d8dcb4284", "hasInstallScript": true, "license": "Apache-2.0" }, diff --git a/package.json b/package.json index c7c48dba7f22..cabc12755740 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@duckduckgo/autoconsent": "^5.1.0", - "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#8.1.1", + "@duckduckgo/autofill": "github:duckduckgo/duckduckgo-autofill#8.1.2", "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#4.32.0", "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#1.4.0", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#1689964986"