Closed Bug 1587132 Opened 5 years ago Closed 5 years ago

Add-on homepage link is not opened in browser

Categories

(Thunderbird :: Add-Ons: General, defect)

defect
Not set
normal

Tracking

(thunderbird_esr6870+ fixed)

VERIFIED FIXED
Thunderbird 68.0
Tracking Status
thunderbird_esr68 70+ fixed

People

(Reporter: sancus, Assigned: khushil324)

References

Details

Attachments

(2 files, 2 obsolete files)

See also: Bug 1042280 and Bug 1204317.

Steps to reproduce:

  1. Install any add-on with an external homepage.
  2. Go to the add-on listed in your add-on manager and click on the homepage link.
  3. Note that the link opens in Thunderbird, when it should open in the user's default browser.

Opening arbitrary links not on a Mozilla/Thunderbird domain inside of Thunderbird is incorrect behaviour, in my opinion.

Attached image screenshot of link

Added a screenshot of the specific link I'm referring to.

See Also: → 1042280

Khushil is the man to fix any link issues ;-)

Flags: needinfo?(khushil324)
Assignee: nobody → khushil324
Flags: needinfo?(khushil324)

Toggling network.protocol-handler.expose.http and network.protocol-handler.expose.https to false fixes the bug for be (Thunderbird 60.9.0). However, I think I used to have those set to false earlier already and reverted for some reason, but forgot why.

Also, I think the default behavior is still a bug that should be fixed (toggling the default of these flags might or might not be a reasonable solution).

It's kind of a hack right now. This page is coming from Firefox, so we can only make changes through aboutAddonExtra.js.
This was the default behavior in TB 60. In Firefox 69 onward, they have converted this label into <a>(during de-grid effort of Firefox). Thus in TB 69 onward, this link is opening up in a browser window.
It's debatable that we want to keep this behavior in TB 68 as this was also the same in TB 60 or use this kind of hack to make this work.

Attachment #9099987 - Flags: review?(sancus)
Attachment #9099987 - Flags: feedback?(jorgk)
Status: NEW → ASSIGNED
Comment on attachment 9099987 [details] [diff] [review]
Bug-1587132_add-on-homepage-link-fix.patch

Well, Andrei can try it. I'm not signing off on JS hacks, only C++ ones ;-) - I'll let Magnus make the call here.
Attachment #9099987 - Flags: review?(sancus)
Attachment #9099987 - Flags: review?(mkmelin+mozilla)
Attachment #9099987 - Flags: feedback?(sancus)
Attachment #9099987 - Flags: feedback?(jorgk)
Attachment #9099987 - Attachment is obsolete: true
Attachment #9099987 - Flags: review?(mkmelin+mozilla)
Attachment #9099987 - Flags: feedback?(sancus)
Attachment #9100022 - Flags: review?(mkmelin+mozilla)
Attachment #9100022 - Flags: feedback?(sancus)

(In reply to Khushil Mistry [:khushil324] from comment #4)

It's kind of a hack right now. This page is coming from Firefox, so we can only make changes through aboutAddonExtra.js.
This was the default behavior in TB 60. In Firefox 69 onward, they have converted this label into <a>(during de-grid effort of Firefox). Thus in TB 69 onward, this link is opening up in a browser window.
It's debatable that we want to keep this behavior in TB 68 as this was also the same in TB 60 or use this kind of hack to make this work.

I think the behaviour in TB60 is also a bug. Someone can correct me if I'm wrong, but the rule is that we should always open links to external websites in the user's browser. For example, links in any email.

The only exception to this is when we are using pages on domains we explicitly control as "part of the client" like with the Start Page and the Add-ons Manager. This is really just remote hosting content we own, we have full control over it, so it is known safe.

In general, any case where an arbitrary user or developer-entered url opens in Thunderbird is a bug, because Thunderbird isn't intended to be used as a browser by end users, it's not 100% safe. We have made other decisions like Bug 1549562 with the assumption that we do not expose any attack surface to external websites.

Comment on attachment 9100022 [details] [diff] [review]
Bug-1587132_add-on-homepage-link-fix.patch

Review of attachment 9100022 [details] [diff] [review]:
-----------------------------------------------------------------

Why not just add the event listeners to the exiting element?

I tried that but text-link component has a click event listener on the bubbling phase. So If I add the event listener to the component, event listener from the CE itself will take precedence so the link will be opened up in TB and browser both, event.stopPropagation() will have no significance. Also, we can't remove the event listener from the aboutAddonExtra.js.

Comment on attachment 9100022 [details] [diff] [review]
Bug-1587132_add-on-homepage-link-fix.patch

Review of attachment 9100022 [details] [diff] [review]:
-----------------------------------------------------------------

I guess this is alright. Would add a code comment explaining that we hide the original and add another link to make sure we open in the browser instead of internally.
Attachment #9100022 - Flags: review?(mkmelin+mozilla) → review+

I might add the comment myself unless Khushil beats me to it.

Keywords: checkin-needed

I was just on it :)

Attachment #9100022 - Attachment is obsolete: true
Attachment #9100022 - Flags: feedback?(sancus)
Attachment #9100749 - Flags: review+
Comment on attachment 9100749 [details] [diff] [review]
Bug-1587132_add-on-homepage-link-fix.patch

I guess you want this backported.
Attachment #9100749 - Flags: approval-comm-esr68+
Attachment #9100749 - Flags: approval-comm-beta+

Umm, this patch doesn't apply to trunk. This is only for 68 ESR? I tried on trunk and link already opens in the external browser.

Keywords: checkin-needed
Target Milestone: --- → Thunderbird 68.0

Yes, it's TB68 only patch.

Attachment #9100749 - Flags: approval-comm-beta+

OK, no checkin-needed, it's handled via the other flags.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Working in TB 68.2.0 ESR.

Status: RESOLVED → VERIFIED
Regressions: 1591693
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: