[epiphany/mcatanzaro/passwords: 23/35] ephy.js: passwordNode is now required for _findFormAuthElements
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/passwords: 23/35] ephy.js: passwordNode is now required for _findFormAuthElements
- Date: Tue, 5 Mar 2019 20:53:57 +0000 (UTC)
commit a5c04160cfb9969de99031efcde2f89b4ea182dd
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Mar 3 15:39:26 2019 -0600
ephy.js: passwordNode is now required for _findFormAuthElements
i.e. if passwordNode is unset, always just return null. That way we
don't have to check it at every callsite. usernameNode is optional, but
passwordNode is not.
embed/web-extension/resources/js/ephy.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/embed/web-extension/resources/js/ephy.js b/embed/web-extension/resources/js/ephy.js
index 8da816d1c..95c921d1c 100644
--- a/embed/web-extension/resources/js/ephy.js
+++ b/embed/web-extension/resources/js/ephy.js
@@ -426,9 +426,8 @@ Ephy.FormManager = class FormManager
preFillForms()
{
this._formAuth = this._findFormAuthElements(true);
- if (!this._formAuth || !this._formAuth.passwordNode) {
+ if (!this._formAuth) {
Ephy.log('No pre-fillable/hookable form found');
- this._formAuth = null;
return;
}
@@ -495,10 +494,8 @@ Ephy.FormManager = class FormManager
return;
this._formAuth = this._findFormAuthElements(false);
- if (!this._formAuth || !this._formAuth.passwordNode) {
- this._formAuth = null;
+ if (!this._formAuth)
return;
- }
if (!this._formAuth.passwordNode.value || !this._formAuth.passwordNode.name)
return;
@@ -683,6 +680,9 @@ Ephy.FormManager = class FormManager
if (passwordNodeIndex >= 0)
passwordNode = passwordNodes[passwordNodeIndex].element;
+ if (!passwordNode)
+ return null;
+
return { 'usernameNode' : usernameNode, 'passwordNode' : passwordNode };
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]