[epiphany] Make password autofill compatible with Angular forms
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Make password autofill compatible with Angular forms
- Date: Wed, 26 Oct 2016 16:28:20 +0000 (UTC)
commit e34c87c316ca16dfe608def225523d2fe5872fbb
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Thu Oct 6 15:57:14 2016 -0500
Make password autofill compatible with Angular forms
Honestly, I have no clue what I've done here, but it's what Chromium
does when it autofills a form, and it makes an Angular password form
work on one of our internal sites, so it's probably good right?
https://bugzilla.gnome.org/show_bug.cgi?id=772530
embed/web-extension/ephy-web-extension.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 25e3821..d5c4aa5 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -379,20 +379,26 @@ fill_form_cb (const char *username,
gpointer user_data)
{
EphyEmbedFormAuth *form_auth = EPHY_EMBED_FORM_AUTH (user_data);
- WebKitDOMNode *username_node;
+ WebKitDOMHTMLInputElement *username_node;
+ WebKitDOMHTMLInputElement *password_node;
if (username == NULL && password == NULL) {
LOG ("No result");
return;
}
- username_node = ephy_embed_form_auth_get_username_node (form_auth);
+ username_node = WEBKIT_DOM_HTML_INPUT_ELEMENT (ephy_embed_form_auth_get_username_node (form_auth));
+ password_node = WEBKIT_DOM_HTML_INPUT_ELEMENT (ephy_embed_form_auth_get_password_node (form_auth));
LOG ("Found: user %s pass (hidden)", username_node ? username : "(none)");
- if (username_node)
+ if (username_node) {
g_object_set (username_node, "value", username, NULL);
- g_object_set (ephy_embed_form_auth_get_password_node (form_auth),
- "value", password, NULL);
+ webkit_dom_html_input_element_set_auto_filled (username_node, TRUE);
+ webkit_dom_html_input_element_set_editing_value (username_node, username);
+ }
+ g_object_set (password_node, "value", password, NULL);
+ webkit_dom_html_input_element_set_auto_filled (password_node, TRUE);
+ webkit_dom_html_input_element_set_editing_value (password_node, password);
}
static gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]