From bb845255fc5a95b2524d6864b4dbe517b0666b01 Mon Sep 17 00:00:00 2001 From: DK Date: Mon, 6 Mar 2017 16:37:50 +0300 Subject: [PATCH] add network.standard-url.escape-utf8 preference --- modules/content-buffer.js | 7 +++++-- modules/history.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/content-buffer.js b/modules/content-buffer.js index 8687595d..169be77a 100644 --- a/modules/content-buffer.js +++ b/modules/content-buffer.js @@ -29,6 +29,9 @@ define_current_buffer_hook("current_content_buffer_location_change_hook", "conte define_current_buffer_hook("current_content_buffer_status_change_hook", "content_buffer_status_change_hook"); define_current_buffer_hook("current_content_buffer_focus_change_hook", "content_buffer_focus_change_hook"); +function maybe_decode_uri (uri) { + return get_pref("network.standard-url.escape-utf8") ? uri : decodeURIComponent(uri); +} function content_buffer_modality (buffer) { var elem = buffer.focused_element; @@ -184,7 +187,7 @@ content_buffer.prototype = { }, get title () { return this.browser.contentTitle; }, - get description () { return this.display_uri_string; }, + get description () { return maybe_decode_uri(this.display_uri_string); }, load: function (load_spec) { apply_load_spec(this, load_spec); @@ -422,7 +425,7 @@ minibuffer.prototype.read_url = function () { */ function overlink_update_status (buffer, node) { if (node && node.href.length > 0) - buffer.window.minibuffer.show("Link: " + node.href); + buffer.window.minibuffer.show("Link: " + maybe_decode_uri(node.href)); else buffer.window.minibuffer.clear(); } diff --git a/modules/history.js b/modules/history.js index e7d2daca..0526ca40 100644 --- a/modules/history.js +++ b/modules/history.js @@ -19,7 +19,7 @@ history_completions.prototype = { toString: function () "#", root: null, destroy: function () { this.root.containerOpen = false; }, - get_string: function (i) this.root.getChild(i).uri, + get_string: function (i) maybe_decode_uri(this.root.getChild(i).uri), get_description: function (i) this.root.getChild(i).title, get_value: function (i) this.root.getChild(i), };