Context menus appear not to be cleared when reloading in the debugger




WebExtensions: General
11 months ago
10 months ago


(Reporter: jkt, Unassigned)


54 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [contextMenus], triaged)


(2 attachments)



11 months ago
Created attachment 8875677 [details]

I was working on the following:


1. Load the extension in about:debugging
2. Load the debugger
3. Hit Ctrl+R in the debugger window
4. Right click in a window

Expected outcomes:

One context menu item for the extension


For each reload I get a different context menu

I'm on Nightly on 16.04 Ubuntu

Comment 1

11 months ago
By looking into the context menu implementation it looks like the context menu items defined by an extension are removed only when the extension is disabled (or uninstalled):


I suspect that by pressing Ctrl+R in the debugger window, while a WebExtension background page is selected in the addon debugger window, a `window.location.reload()` is triggered on the background page (instead of the addon reload triggered by the reload button from the about:debugging page).

Do you mind retrying the STR with "press the reload button in the about:debugging page" as its step 3?
This will confirm that the context menu items are correctly refreshed when the entire addon is reloaded.
Flags: needinfo?(jkt)

Comment 2

11 months ago
Created attachment 8875689 [details]

This does indeed clear it. No amount of Ctrl+R cleared it.
Pressing the reload button fast in about:debugging adds the items not in a sub menu (This is likely a race condition on the unloading then loading perhaps?)
Flags: needinfo?(jkt)

Comment 3

11 months ago
I tested this on chrome and it has the same behavior:

- if you manually reload the background page, a new context menu item is created for each reload (both by pressing Ctrl-R in the chrome addon debugging window or by doing a window.location.reload() in the console panel)
- if you reload the entire addon from chrome://extensions using the reload link, all the created context menu items are removed and there will be only one

So, it looks like the behavior is the expected one in both the implementations.

I've not been able to reproduce the issue from attachment 8875689 [details] described comment 2 (clicking fast the "about:debugging" reload link more times) on Firefox Nightly, though.

Comment 4

10 months ago
luca commenting
Flags: needinfo?(lgreco)
Whiteboard: [contextMenus], triaged

Comment 5

10 months ago
Hi :jkt,
I'm marking this issue as invalid because, as described in Comment 3, the current behavior is the expected one (and Chrome shares the same behavior):

reloading the background page doesn't remove the context menu items created from that context (while reloading the entire addon remove all the context menu items as expected).

I tried to reproduce the other issue described in comment 2 (multiple fast clicks on the about:debugging addon reload action) without any luck, but if you find an STR that consistently reproduces it, feel free to open a new bugzilla issue specifically for it.
Last Resolved: 10 months ago
Flags: needinfo?(lgreco)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.