commit 4c0b11d76d773c471f7d4884e7d0764f6ef00c7b Author: Richard Pospesel richard@torproject.org Date: Mon Oct 21 17:02:31 2019 -0700
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 f33b9b6a6d24..fe4a21832d54 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() {
tbb-commits@lists.torproject.org