Closed Bug 1795533 Opened 3 years ago Closed 3 years ago

Can't handle unknown protocol (ftp) with arbitrary user-chosen external application (JS errors in ExtHandlerService.jsm)

Categories

(Firefox :: File Handling, defect)

Firefox 105
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: beanladen, Unassigned, NeedInfo)

Details

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

Steps to reproduce:

FF 105 and earlier on Linux (Ubuntu 20.04):
Enter URL ftp://ftp-cdc.dwd.de/pub/CDC/ => not handled by firefox => offers
application selection dialog => entered /usr/bin/filezilla as handler

Actual results:

Nothing. Instead, two errors appeared in browser console:
At popup of application selector (4 times):
TypeError: right-hand side of 'in' should be an object, got undefined2 ExtHandlerService.jsm:772:32
exists resource://gre/modules/ExtHandlerService.jsm:772

After setting application:
TypeError: handlerList is undefined
ExtHandlerService.jsm:498:29
store resource://gre/modules/ExtHandlerService.jsm:498
_prompt Choo
InterpretGeneratorResume self-hosted:1819
AsyncFunctionNext self-hosted:807
close resource://gre/modules/SubDialog.jsm:281
14:07:20.984
[JavaScript Error: "handlerList is undefined" {file: "resource://gre/modules/ExtHandlerService.jsm" line: 498}]'[JavaScript Error: "handlerList is undefined" {file: "resource://gre/modules/ExtHandlerService.jsm" line: 498}]' when calling method: [nsIHandlerService::store] ContentDispatchChooser.jsm:325
handleURI Choo
AsyncFunctionThrow self-hosted:811
close resource://gre/modules/SubDialog.jsm:281

Expected results:

Application should have been fired up.

Component: Untriaged → File Handling

(In reply to beanladen from comment #0)

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

Steps to reproduce:

FF 105 and earlier on Linux (Ubuntu 20.04):

Are you using a snap build from your distro, or an official mozilla.org build (snap or otherwise)? about:support can tell you if you're unsure.

Flags: needinfo?(beanladen)
Summary: Application handler is broken → Can't handle unknown protocol (ftp) with arbitrary user-chosen external application (JS errors in ExtHandlerService.jsm)

It's the normal Canonical (Ubuntu 20.04) build, not the snap (that appears in 22.04) one:

Distribution ID canonical
User Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0
OS Linux 5.4.0-131-generic #147-Ubuntu SMP
OS Theme Yaru / Yaru

Flags: needinfo?(beanladen) → needinfo?(gijskruitbosch+bugs)

Unfortunately I can't reproduce. It works for me (after I install filezilla, and figure out how to input arbitrary paths into the gtk filepicker...).

I mean, I'm assuming you do have something at the path you input. When I didn't, I got different errors anyway (NS_ERROR_FILE_NOT_FOUND, which makes sense).

Assuming that about:support confirms you're not running snap/flatpak, any chance you can try on a clean profile? If that works, can you share your handlers.json file from the profile where it's broken (or at least the ftp-related portion of it) ?

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(beanladen)

Unfortunately given we can't reproduce it's not possible for us to do anything here. We can reopen if it becomes clearer how to reproduce / what's wrong.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Flags: needinfo?(beanladen)

Still doesn't work (Ubuntu 2020.04)
Version 129.0.2
Build ID 20240819150008
Distribution ID canonical
User Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
OS Linux 5.4.0-193-generic #213-Ubuntu SMP Fri Aug 2 19:14:16 UTC 2024
OS Theme Yaru / Yaru

These are the console messages:

20:01:44.174 TypeError: handlerList is undefined
ExtHandlerService.sys.mjs:411:29
store resource://gre/modules/ExtHandlerService.sys.mjs:411
_prompt Choo
InterpretGeneratorResume self-hosted:1420
AsyncFunctionNext self-hosted:807
close resource://gre/modules/SubDialog.sys.mjs:307
20:01:44.174
[JavaScript Error: "handlerList is undefined" {file: "resource://gre/modules/ExtHandlerService.sys.mjs" line: 411}]'[JavaScript Error: "handlerList is undefined" {file: "resource://gre/modules/ExtHandlerService.sys.mjs" line: 411}]' when calling method: [nsIHandlerService::store] ContentDispatchChooser.sys.mjs:108:15
handleURI Choo
close resource://gre/modules/SubDialog.sys.mjs:307
20:01:55.970 Missing resource in locale en-GB: devtools/client/toolbox.ftl
20:01:56.062 Use of nsIFile in content process is deprecated. 15 NetUtil.sys.mjs:249:50

If you:

  1. exit/close Firefox completely
  2. move your handlers.json file in your profile to a different location
  3. reopen Firefox

Does that fix it?

Flags: needinfo?(beanladen)
You need to log in before you can comment on or make changes to this bug.