Closed Bug 1339172 Opened 9 years ago Closed 8 years ago

Remove context menu listeners when removing context menus

Categories

(WebExtensions :: Untriaged, defect, P5)

54 Branch
defect

Tracking

(Not tracked)

RESOLVED INVALID
webextensions +

People

(Reporter: geoffreydebelie, Unassigned)

References

Details

(Keywords: stale-bug, Whiteboard: [contextmenus, triaged])

Attachments

(1 file)

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.
See Also: → 1338789
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Assignee: nobody → mwein
Priority: -- → P1
Whiteboard: [contextmenus, triaged]
webextensions: --- → ?
webextensions: ? → +
Summary: WebExtension: remove context menu listeners when removing context menus → Remove context menu listeners when removing context menus
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
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
Closed: 8 years ago
Flags: needinfo?(geoffreydebelie)
Resolution: --- → INVALID
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)
Status: RESOLVED → REOPENED
Flags: needinfo?(matthewjwein)
Resolution: INVALID → ---
This bug makes no sense to me. If you add a listener, it has nothing to do with specific menu items or how many of them exist. If you want to remove the listener, there's an API for that. The test addon doesn't receive onclick events for the removed menu items, it does for the new menu items you added.
Assignee: matthewjwein → nobody
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Priority: P1 → P5
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: