Closed Bug 1780374 Opened 4 years ago Closed 1 year ago

link extension context menu is not added for References links in header pane for news messages

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

RESOLVED FIXED
137 Branch

People

(Reporter: manikulin, Assigned: welpy-cw)

Details

Attachments

(1 external file)

Steps to reproduce:

Consider an extension that register a menu entry for the "link" context. The menu item does not appear for the "References" links in the header pane for news (NNTP) messages despite such links from user point of view are essentially the same as "mid:" links.

  • Load some add-on that handles links through a context menu item, an example is provided below.
  • Check that context menu appears for links in message body.
  • Try some message from a news account that does not start new thread so has "References" field in the headers pane.
  • Inspect context menu items for a "References" link.

manifest.json

{
	"manifest_version": 2,
	"name": "Link Menus Test",
	"version": "0.1",
	"background": { "scripts": [ "linmen-bg.js" ] },
	"permissions": [ "menus" ]
}

linmen-bg.js

"use strict";

async function linmenCreateMenu() {
	await browser.menus.removeAll();

	browser.menus.create({
		contexts: [ "link" ],
		id: "LINMEN_LINK",
		title: "Link Menu Test",
	}, function linmenOnMenusCreated() {
		const error = browser.runtime.lastError;
		if (error) {
			console.error("linmenOnMenusCreated: error: %o", error);
		}
	});
}

browser.menus.onClicked.addListener((clickData, tab) =>
	console.log("linmen.onClicked: %o", clickData, tab));
linmenCreateMenu();

Actual results:

No menu item appears, so add-on can not handle "References" links.

The behavior is the same for thunderbird-104.0a1.

Expected results:

  • Menu item is displayed for "References" links.
  • Menu handler is called as for a "mid:" link.

P.S. Actually discrepancy of behavior for "mid:" links and for "References" is greater for some reason. Click on a reference does not open new tab or window.

Confirmed, that the References link is ignored by the link context.

To fully understand your report. Where does the mid: link appear, which you referred to? Is that an arbitrary link inside a news message?

Status: UNCONFIRMED → NEW
Ever confirmed: true

(In reply to John Bieling (:TbSync) from comment #1)

To fully understand your report. Where does the mid: link appear, which you referred to? Is that an arbitrary link inside a news message?

Yes, I mean mid: (and news:) links in the message body pane. I believe, the behavior should be consistent with links creates for "References" Message-IDs. (Side note: today I noticed that the "References" header disappears when message is copied from a newsgroup to local folders).

I added "P.S." since it is likely out of scope for add-ons. If you agree with my observation, the issue may be cloned.

I added "P.S." since it is likely out of scope for add-ons. If you agree with my observation, the issue may be cloned.

Yes, that is a different issue and unrelated, so it is better to file a new bug for that in the "Mail Window Frontend" or "Message Reader UI" component.

(In reply to John Bieling (:TbSync) from comment #3)

I added "P.S." since it is likely out of scope for add-ons. If you agree with my observation, the issue may be cloned.

Yes, that is a different issue and unrelated, so it is better to file a new bug for that in the "Mail Window Frontend" or "Message Reader UI" component.

See the Bug #1785790 (I am sorry, I forgot to set component).

In the meanwhile I have realized that mail addresses displayed in the header pane should be available to extensions as "mailto:" links.

Unsure if you would prefer it as a separate issue or here in the broad context of link-like objects unavailable to extensions:
email address bars in message compose windows should be the same as mailto: links for add-on context menu items.

Component: Add-Ons: General → Add-Ons: Extensions API
Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Attachment #9463075 - Attachment description: Bug 1780374 - Add Message ID context menus in header view to the "link" context of the menus API. r=john.bieling → Bug 1780374 - Make Message ID context menus in header view accessible in the menus API. r=john.bieling
Target Milestone: --- → 137 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f7dd2bf38cac
Make Message ID context menus in header view accessible in the menus API. r=john.bieling

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: