Closed Bug 1567459 Opened 5 years ago Closed 5 years ago

Menus in context "selection" not working in Thunderbird Add-on

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1579059

People

(Reporter: ed-elric, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36

Steps to reproduce:

Go to Gebugging Firefox tools in Thunderbird and try to load temporary add-on with a manifest.json with { "permissions": ["menus"]}. In js-file try to create menus: browser.menus.create({
id: "some_id",
title: "custom item",
contexts: ["selection"],
onclick: some_function
});

Actual results:

I've got an error rigth after loading my temporary add-on:
"Reading manifest: Error processing permissions.0: Value "menus" must either: must either [must either [be one of ["clipboardRead"..."
Shortly saying TB doesn't support "menus" api key. Same addon works perfectly fine in Firefox browser. In console I see: TypeError: browser.menus is undefined.

Expected results:

I would like to add custom menu item to the context menu. Official TB documentation https://buildmedia.readthedocs.org/media/pdf/thunderbird-webextensions/latest/thunderbird-webextensions.pdf says it should work, but it doesn't.

Flags: needinfo?(geoff)

What version of Thunderbird are you using?

Flags: needinfo?(geoff) → needinfo?(ed-elric)

(In reply to Geoff Lankow (:darktrojan) from comment #1)

What version of Thunderbird are you using?

I'm using 60.8.0

Flags: needinfo?(ed-elric)

The menus API and most of the other APIs are not in Thunderbird 60. They are in Thunderbird 68, which is very nearly here.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

So now I've tried it with 68.0 and 68.0b5 and it's still not working.

Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(geoff)
Resolution: INVALID → ---

This must be working or the test for it would be failing, not to mention the add-ons I have installed that use it. I'm not sure what you're doing wrong but it's not a bug, at least not as described here.

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Flags: needinfo?(geoff)
Resolution: --- → WORKSFORME

(In reply to Geoff Lankow (:darktrojan) from comment #5)

This must be working or the test for it would be failing, not to mention the add-ons I have installed that use it. I'm not sure what you're doing wrong but it's not a bug, at least not as described here.

Thank you for the example, it seems to be the issue with the "selection" context. I wanted my context menu item to appear when part of a page is selected, but nothing was happening. With your example it shows that the context is still "page", not "selection" when I select some text in the email.

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Flags: needinfo?(geoff)
Summary: Menus API not working in Thunderbird Add-on → Menus in context "selection" not working in Thunderbird Add-on

I think this will be solved by fixing bug 1504475, which I am really hoping to find time to do soon.

Depends on: 1504475
Flags: needinfo?(geoff)
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.