Closed Bug 1590538 Opened 5 years ago Closed 5 years ago

Copying a link and using "Paste & Go" results in error when HTTPS Everywhere add-on is installed

Categories

(Firefox :: Address Bar, defect, P3)

68 Branch
defect
Points:
1

Tracking

()

RESOLVED FIXED
Firefox 72
Iteration:
72.1 - Oct 21 - Nov 3
Tracking Status
firefox72 --- fixed

People

(Reporter: richard, Assigned: mak)

Details

(Whiteboard: [tor 31764])

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

With the HTTPS Everywhere add-on installed:

  • right click a link and select 'Copy Link Location'
  • right click the UrlBar content area and select 'Paste and Go'

Actual results:

Navigation succeeds, but the following error is printed in the browser console:

Received unexpected result type undefined, falling back to typed transition. WebNavigation.jsm:217
onURLBarUserStartNavigation resource://gre/modules/WebNavigation.jsm:217
observe resource://gre/modules/WebNavigation.jsm:136
_notifyStartNavigation resource:///modules/UrlbarInput.jsm:1364
_loadURL resource:///modules/UrlbarInput.jsm:1240
handleCommand resource:///modules/UrlbarInput.jsm:446
_initPasteAndGo resource:///modules/UrlbarInput.jsm:1333

I have a small patch along with an explanation of the problem here: https://gitweb.torproject.org/user/richard/tor-browser.git/commit/?h=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 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).

Tor Browser ticket: https://trac.torproject.org/projects/tor/ticket/31764

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Address Bar
Whiteboard: [tor 31764]

The bug seems to be that _loadURL sets result default value to {} instead of null, and that bypasses this check
https://searchfox.org/mozilla-central/rev/2a355e56c490768be676689de18629485c9d699b/toolkit/components/extensions/WebNavigation.jsm#184

the reportError was intended for invalid data, not for the case a result doesn't exist. We should make the default value of the param null, not an empty object.

Thanks for the report.

Assignee: nobody → mak
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P3
Iteration: --- → 72.1 - Oct 21 - Nov 3
Points: --- → 1
Pushed by mak77@bonardo.net:
https://hg.mozilla.org/integration/autoland/rev/fe92ffb951e8
Don't pass an empty object to urlbar-user-start-navigation because it doesn't handle it properly. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: