Closed Bug 1816343 Opened 1 month ago Closed 1 month ago

Command handler doesn't handle file:// URLs leading to problems opening .ics or .eml files via the XDG Desktop Entry Specification using %u

Categories

(Thunderbird :: General, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird111 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird111 --- fixed

People

(Reporter: yuilytg7, Assigned: mkmelin)

Details

(Whiteboard: [TM:102.9.1])

Attachments

(1 file)

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

Steps to reproduce:

In /usr/share/applications/thunderbird.desktop, the Exec directive says:

Exec=/usr/lib/thunderbird/thunderbird %u

The "XDG Desktop Entry Specification" states that "%u" is "A single URL. Local files may either be passed as file: URLs or as file path. ".

However, Thunderbird does not seem to support "file: URLs" paths.

In fact, I use mimeo as my file opener.

When I configure it to open .ics files with Thunderbird, it calls:

❯ mimeo --debug 2022507AR0704.ics 
[...]
DEBUG: /usr/lib/thunderbird/thunderbird file:///home/[MYUSERNAME]/Downloads/[MYFILE].ics

and Thunderbird returns the error:

JavaScript error: resource:///modules/MessengerContentHandler.jsm, line 508: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsICommandLine.resolveFile]

So I think the "%u" in the desktop file should be "%f", which is described by the specification as "A single file name (including the path)", which is what Thunderbird seems to support.

Actual results:

See above

Expected results:

See above

The real bug seems to be that Thunderbird cannot handle "file URL:" schemes.

Here is a patch to fix it: https://github.com/Betterbird/thunderbird-patches/blob/main/102/bugs/1816343-command-line-file-url.patch

This patch was provided by the Betterbird team here: https://github.com/Betterbird/thunderbird-patches/issues/121

Summary: Desktop file should contain %f instead of %u → Command handler doesn't handle file:// URLs leading to problems opening .ics or .eml files via the XDG Desktop Entry Specification using %u
Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Target Milestone: --- → 112 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/bd926e18fe4e
Make command line handler handle files passed as file:// urls. r=rjl

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED

Comment on attachment 9317539 [details]
Bug 1816343 - Make command line handler handle files passed as file:// urls. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): never worked
User impact if declined: command line can't handle file:/// urls
Testing completed (on c-c, etc.): c-c, beta
Risk to taking this patch (and alternatives if risky): not risky

Attachment #9317539 - Flags: approval-comm-esr102?
Attachment #9317539 - Flags: approval-comm-beta?

Comment on attachment 9317539 [details]
Bug 1816343 - Make command line handler handle files passed as file:// urls. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9317539 - Flags: approval-comm-beta? → approval-comm-beta+
Whiteboard: [TM:102.9.1]

Comment on attachment 9317539 [details]
Bug 1816343 - Make command line handler handle files passed as file:// urls. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr102

Attachment #9317539 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.