Subject: [PATCH] Place a notification on the URL panel for a script on a link.

If following a link during a hints interaction would also execute a
script, the URL panel now includes the text "[script]" to warn the
user.
---

Hi John,

Thanks again for the style note.

If it helps you, just ask me to push any of the patches you're happy
with (I'll rebase them on master first).

Regards, David


 modules/hints.js |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/hints.js b/modules/hints.js
index 8544333..5d7309f 100644
--- a/modules/hints.js
+++ b/modules/hints.js
@@ -431,17 +431,24 @@ function hints_url_panel (hints, window) {
     window.minibuffer.insert_before(p);
 
     p.update = function () {
-       url_value.value = "";
+       var s = [];
        if (hints.manager && hints.manager.last_selected_hint) {
             var spec;
+            var elem = hints.manager.last_selected_hint.elem;
+            if (elem.hasAttribute("onmousedown") ||
+                elem.hasAttribute("onclick"))
+            {
+                s.push("[script]");
+            }
             try {
-                spec = load_spec(hints.manager.last_selected_hint.elem);
+                spec = load_spec(elem);
             } catch (e) {}
             if (spec) {
                 var uri = load_spec_uri_string(spec);
-                if (uri) url_value.value = uri;
+                if (uri) s.push(uri);
             }
        }
+        p.value = s.join(" ");
     };
 
     p.destroy = function () {
-- 
1.7.6.3

_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to