[epiphany/mcatanzaro/#1186] Fix insecure form focused warning



commit 125052f8a3c57a8631630c6c5e3e64ad3bbb86a8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Jun 5 09:56:07 2020 -0500

    Fix insecure form focused warning
    
    45de197e broke our warning message when the user focuses an insecure
    password form. Problem is that most of our password form handling
    switched to using frame ID rather than page ID, but for this warning I
    only changed the web process, not the UI process. So the UI process
    receives a frame ID, compares it to the web view's page ID, decides it
    doesn't match, and throws away the message. There's no need to use frame
    IDs here, so switch the web process back to using page IDs.
    
    Fixes #1186

 embed/web-process-extension/ephy-web-process-extension.c | 4 ++--
 embed/web-process-extension/resources/js/ephy.js         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/embed/web-process-extension/ephy-web-process-extension.c 
b/embed/web-process-extension/ephy-web-process-extension.c
index b341b37c5..a8631b86c 100644
--- a/embed/web-process-extension/ephy-web-process-extension.c
+++ b/embed/web-process-extension/ephy-web-process-extension.c
@@ -119,13 +119,13 @@ web_page_will_submit_form (WebKitWebPage            *web_page,
 }
 
 static char *
-password_form_message_serializer (guint64  frame_id,
+password_form_message_serializer (guint64  page_id,
                                   gboolean is_insecure_action)
 {
   GVariant *variant;
   char *message;
 
-  variant = g_variant_new ("(tb)", frame_id, is_insecure_action);
+  variant = g_variant_new ("(tb)", page_id, is_insecure_action);
   message = g_variant_print (variant, FALSE);
   g_variant_unref (variant);
 
diff --git a/embed/web-process-extension/resources/js/ephy.js 
b/embed/web-process-extension/resources/js/ephy.js
index e71fd4971..028919717 100644
--- a/embed/web-process-extension/resources/js/ephy.js
+++ b/embed/web-process-extension/resources/js/ephy.js
@@ -615,7 +615,7 @@ Ephy.FormManager = class FormManager
                 }
             }
         }
-        
window.webkit.messageHandlers.passwordFormFocused.postMessage(this._passwordFormMessageSerializer(this._frameID,
 isFormActionInsecure));
+        
window.webkit.messageHandlers.passwordFormFocused.postMessage(this._passwordFormMessageSerializer(this._pageID,
 isFormActionInsecure));
     }
 
     _findPasswordFields()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]