[epiphany/gnome-3-32] Fix type error when form doesn't have an action



commit 30fd593e0e7274f5febb059a28f56ba1e52949b8
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Jul 5 16:15:06 2019 -0500

    Fix type error when form doesn't have an action
    
    In this case, we assume the form is secure. The page is going to do
    something with the form result manually, and there's no way to know
    what.

 embed/web-extension/resources/js/ephy.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/embed/web-extension/resources/js/ephy.js b/embed/web-extension/resources/js/ephy.js
index 874aad9af..9c6a4f6b7 100644
--- a/embed/web-extension/resources/js/ephy.js
+++ b/embed/web-extension/resources/js/ephy.js
@@ -593,9 +593,12 @@ Ephy.FormManager = class FormManager
 
     _sensitiveElementFocused(event)
     {
-        let url = new URL(this._form.action);
-        // Warning: we do not whitelist localhost because it could be redirected by DNS.
-        let isInsecureAction = url.protocol == 'http:' && url.hostname != "127.0.0.1" && url.hostname != 
"::1";
+        let isInsecureAction = false;
+        if (this._form.action) {
+            let url = new URL(this._form.action);
+            // Warning: we do not whitelist localhost because it could be redirected by DNS.
+            isInsecureAction = url.protocol == 'http:' && url.hostname != "127.0.0.1" && url.hostname != 
"::1";
+        }
         
window.webkit.messageHandlers.sensitiveFormFocused.postMessage(this._sensitiveElementMessageSerializer(this._pageID,
 isInsecureAction));
     }
 


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