From 8221433fd434f1821ebaf5e105db5903b199cdfe Mon Sep 17 00:00:00 2001 From: Richard Pospesel Date: Mon, 21 Oct 2019 17:02:31 -0700 Subject: [PATCH] Bug 31764: Fix for error when navigating via 'Paste and go' The onURLBarUserStartNavigation callback expects an object from the UrlBarInput with information about how a URL was navigated to. This specifically helps to deal with the various buttons and links in the UrlBar dropdown (search engines, bookmarks, suggestions, etc). However, when using 'Paste and go' this data is not present nor relevant and an empty object {} is provided instead. This also happens if the user types the 'verbose url' (for example: https://www.example.com rather than www.example.com), navigates away from the urlbar thus dismissing the dropdown, then navigating back to the urlbar and hitting enter. Pasting the less 'verbose url' causes the code to go down another path which attempts to resolve the actual url before attempting to call _loadURL with a null result object, rather than an empty {} result object. In this scenario no exception is thrown. This patch explicitly passes null rather than implicitly passing {} to _loadURL when a resolved 'verbose' url is entered into the UrlBar via 'Paste and go' (as well as the previously described type -> dismiss popup -> enter flow). --- browser/components/urlbar/UrlbarInput.jsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index a1b33930033d3..cb0ab15d7ebfd 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -443,7 +443,7 @@ class UrlbarInput { return; } - this._loadURL(url, where, openParams); + this._loadURL(url, where, openParams, null); } handleRevert() { -- GitLab