Skip to content

Commit

Permalink
Fix extension bugs (#366)
Browse files Browse the repository at this point in the history
* Ensure private addresses are refreshed

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

* Fix button sometimes not clickable

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

* Fix flytap.com username

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

* Commit compiled code

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

* Fix test failure

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

---------

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
  • Loading branch information
GioSensation authored Aug 10, 2023
1 parent e1207b3 commit b333fb3
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 59 deletions.
28 changes: 16 additions & 12 deletions dist/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions dist/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions src/DeviceInterface/InterfacePrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,20 @@ class InterfacePrototype {
* This is desktop only: was it a private address? if so, save it with
* 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
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')
}
this.storeFormData(formValues, 'emailProtection')
}

await this.removeTooltip()
Expand Down
2 changes: 2 additions & 0 deletions src/Form/selectors-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ const username = [
`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]`
]

Expand Down
43 changes: 43 additions & 0 deletions src/Form/test-cases/flytap_login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- https://www.flytap.com/en-pt/ -->
<form id="js-login-account-modal" autocomplete="off" novalidate="novalidate">
<fieldset>
<legend class="prop-hide--sreader">Sign into your account</legend>
<div class="matrix-tap__row">
<div class="matrix-tap__col">
<div class="formdefault-tap__field-group light-input-tap">
<input class="formdefault-tap__input-field vld-email-tpnumber clearinput-tap-field" name="login-user-account-modal" id="login-user-account-modal" type="text" placeholder=" " data-manual-scoring="username"><button class="clearinput-tap-buttton prop-display--none" aria-label="clearinput">clearinput</button>
<div class="formdefault-tap__input-label-wrapper">
<label class="formdefault-tap__input-label" for="login-user-account-modal">Email or Client Number (TP)</label>
</div>
</div>
</div>
</div>
<div class="matrix-tap__row">
<div class="matrix-tap__col">
<div class="formdefault-tap__field-group light-input-tap">
<div class="formdefault-tap__input-password-wrapper">
<input type="password" name="login-pass-account-modal" id="login-pass-account-modal" class="formdefault-tap__input-field" maxlength="32" value="" autocapitalize="off" placeholder=" " required="" aria-required="true" data-manual-scoring="password">
<button type="button" id="for-2-login-pass-account-modal" class="link js-passwordChars">
<span class="icn-svg svg-icn-hide-pass-grey">Hide password</span>
<span class="icn-svg svg-icn-show-pass-grey">Show password</span>
</button>
<div class="formdefault-tap__input-label-wrapper">
<label class="formdefault-tap__input-label" for="login-pass-account-modal">Password</label>
</div>
</div>
</div>
</div>
</div>
<div class="matrix-tap__row">
<div class="matrix-tap__col">
<div class="formdefault-tap__field-group">
<div class="formdefault-tap__input-checker-wrapper formdefault-tap__input-checker-color-variation checked">
<input class="formdefault-tap__input-checker-input" type="checkbox" name="login-save-account-modal" id="login-save-account-modal" value="Remember me" checked="">
<label class="formdefault-tap__input-label--check" for="login-save-account-modal">
Remember me </label>
</div>
</div>
</div>
</div>
</fieldset>
</form>
4 changes: 3 additions & 1 deletion src/Form/test-cases/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,5 +495,7 @@
{ "html": "ua_ctcorpmpc_com-signup.html" },
{ "html": "joybird_com.html" },
{ "html": "ikea_signup-verification.html", "expectedSubmitFalsePositives": 2 },
{ "html": "chase_2fa-verification-step.html", "expectedFailures": ["unknown"] }
{ "html": "chase_2fa-verification-step.html", "expectedFailures": ["unknown"] },
{ "html": "flytap_login.html" }

]
2 changes: 1 addition & 1 deletion src/UI/HTMLTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class HTMLTooltip {
dispatchClick () {
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')) {
safeExecute(this.activeButton, handler, {
checkVisibility: this.options.checkVisibility
})
Expand Down
28 changes: 16 additions & 12 deletions swift-package/Resources/assets/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions swift-package/Resources/assets/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b333fb3

Please sign in to comment.