Remove context menu listeners when removing context menus

REOPENED
Assigned to

Status

()

Toolkit
WebExtensions: Untriaged
P1
normal
REOPENED
6 months ago
4 days ago

People

(Reporter: Geoffrey De Belie (Smile4ever), Assigned: mattw)

Tracking

54 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [contextmenus, triaged])

Attachments

(1 attachment)

(Reporter)

Description

6 months ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170212110301

Steps to reproduce:

If you remove context menus using browser.contextMenus.removeAll(), it does not remove the listeners attached to those context menu items.

So if you create context menu items with the same id as the ones who were deleted, the listeners are still attached.

This is a feature request to remove all the listeners that are attached to the context menu items that are being deleted.
(Reporter)

Updated

6 months ago
See Also: → bug 1338789
(Reporter)

Updated

6 months ago
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit

Updated

6 months ago
Assignee: nobody → mwein
Priority: -- → P1
Whiteboard: [contextmenus, triaged]
webextensions: --- → ?

Updated

5 months ago
webextensions: ? → +
Summary: WebExtension: remove context menu listeners when removing context menus → Remove context menu listeners when removing context menus
(Assignee)

Updated

2 months ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Comment 1

2 months ago
I believe this bug is invalid, as the code found here - http://searchfox.org/mozilla-central/source/browser/components/extensions/ext-c-menus.js#156 - should prevent this from ever happening.

Geoffrey, if you believe this is still an issue, could you please provide a sample webextension which reproduces the issue? I was unable to reproduce it locally.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 months ago
Flags: needinfo?(geoffreydebelie)
Resolution: --- → INVALID
(Reporter)

Comment 2

4 days ago
Created attachment 8896787 [details]
TestContextMenuListeners.zip

Test addon showing the problem. It shouldn't log anything when you click the context menu items, but they still have a listener attached so they log their ID.
Flags: needinfo?(geoffreydebelie) → needinfo?(matthewjwein)
(Reporter)

Updated

4 days ago
Status: RESOLVED → REOPENED
Flags: needinfo?(matthewjwein)
Resolution: INVALID → ---
You need to log in before you can comment on or make changes to this bug.