From c2ff332df7d24e233ec26401fa1840ada713a4de Mon Sep 17 00:00:00 2001 From: David Kettler Date: Mon, 26 Sep 2011 18:45:39 +0930 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. --- modules/hints.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/hints.js b/modules/hints.js index 8544333..1f15364 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); } } + url_value.value = s.join(" "); }; p.destroy = function () { -- 2.11.4.GIT