Commit 3ddedd41 authored by Richard Pospesel's avatar Richard Pospesel Committed by Matthew Finkel
Browse files

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).
parent 6a90fec3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ class UrlbarInput {
      return;
    }

    this._loadURL(url, where, openParams);
    this._loadURL(url, where, openParams, null);
  }

  handleRevert() {