Closed Bug 1446031 Opened 6 years ago Closed 6 years ago

A context menu is wrongly displayed if the Notes bottom toolbar is right clicked when you are logged in to account that has non-default note after the sidebar is reopened

Categories

(WebExtensions :: General, defect)

Unspecified
All
defect
Not set
normal

Tracking

(firefox61 affected)

RESOLVED WORKSFORME
Tracking Status
firefox61 --- affected

People

(Reporter: mcoman, Unassigned)

References

Details

(Keywords: regression)

Attachments

(3 files)

Attached image rec of the issue.gif
[Affected versions]:
- Firefox Nightly 61.0a1 Build ID 20180315100042

[Affected Platforms]:
- All Windows
- All Mac
- All Linux

[Prerequisites]:
- Have a Firefox profile with the latest version of the "Firefox Notes" add-on (3.1.0rc3) installed.

[Steps to reproduce]:
1. Open the browser with the profile from prerequisites.
2. Click the "Sync Your Notes" button.
3. Log in into "Firefox Notes" or create a new account.
4. Close and reopen the sidebar.
5. Right click in the bottom toolbar and observe the behavior.

[Expected result]:
- Nothing happens.

[Actual result]:
- A context menu is opened.

[Regression window]:
Last good revision: c842abb7cfbf39e0c1cfb9a1f3a1d6415cd10744
First bad revision: 84ea422093dd615bd191a3e579ed299d96c802f1
Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=c842abb7cfbf39e0c1cfb9a1f3a1d6415cd10744&tochange=84ea422093dd615bd191a3e579ed299d96c802f1

[Notes]:
- The issue is reproducible if the sidebar is switched instead.
- This issue is still reproducible after browser restart.
- The issue is still reproducible after logging out from "Firefox Notes"
- This issue is reproducible with the TxP version of "Firefox Notes".
- Attached a screen recording of the issue.
I'm not sure from the pushlog which bug cause this regression, @Bevis, @Olli and @Tooru could you please take a look and give us your opinion about this regression?
Flags: needinfo?(bugs)
Flags: needinfo?(arai.unmht)
(In reply to Marius Coman [:cmarius] from comment #0)
> [Prerequisites]:
> - Have a Firefox profile with the latest version of the "Firefox Notes"
> add-on (3.1.0rc3) installed.
> 
> [Steps to reproduce]:
> 1. Open the browser with the profile from prerequisites.

how can I have 3.1.0rc3 version installed?
Flags: needinfo?(arai.unmht) → needinfo?(marius.coman)
to be clear, if I install it from Test Pilot, I got 3.0.0, and I don't observe the issue.
Hi Tooru, I have attached the "Firefox Notes" 3.1.0rc3 build.
Flags: needinfo?(marius.coman)
Flags: needinfo?(arai.unmht)
I don't observe the issue with the following steps:
  1. Download attachment 8959453 [details] and rename it to firefox_notes-3.1.0.xpi
  2. Run Nightly 61.0a1 (2018-03-16) (64-bit) with clean profile on macOS
  3. Open about:addons
  4. Drag and drop firefox_notes-3.1.0.xpi to about:addons, and install it
  5. Close and open Nightly (to match to step 1 in comment #0)
  6. Click the "Sync Your Notes" button
  7. Log in into "Firefox Notes" or create a new account
  8. Close and reopen the sidebar, by clicking the "Show sidebars" toolbar button twice
  9. Right click in the bottom toolbar

and nothing happens.
maybe the prerequisites is still different?
Flags: needinfo?(arai.unmht) → needinfo?(marius.coman)
I forgot to write the step between 2 and 3:
  2.1. Open about:config and turn xpinstall.signatures.required to false
(In reply to Tooru Fujisawa [:arai] from comment #5)
>   7. Log in into "Firefox Notes" or create a new account

also, actually I log in to existing Firefox Sync account here.
Tried with the same revision with the following steps, but still not reproducible:

  1. Run `mozregression --launch 20180315100042` on macOS
  2. Open about:config and turn xpinstall.signatures.required to false
  3. Open about:addons
  4. Drag and drop firefox_notes-3.1.0.xpi to about:addons, and install it
  5. Hit F2 and enter "restart"
  6. Click the "Sync Your Notes" button
  7. Log in into existing Firefox Account
  8. Close and reopen the sidebar, by clicking the "Show sidebars" toolbar button twice
  9. Right click in the bottom toolbar
sorry for spam :P

(In reply to Tooru Fujisawa [:arai] from comment #8)
>   5. Hit F2 and enter "restart"
Shift+F2

also, tried the same steps on linux (debian), and not reproducible.
Hi Tooru, I have managed to reproduce the issue using the steps from comment #8 on Windows 10 x64, Mac 10.13, mac 10.11, Debian x64 and Ubuntu 14.04 x64 with the Firefox Nightly 61.0a1 Build ID 20180315100042. 
Considering this could you please post a screen recording, where you try to reproduce the issue, in order to ensure that we both follow the same steps?
Also could you please post a copy of the "about:support" page?
Flags: needinfo?(marius.coman)
Tried also on Windows 10 x64, and not reproducible.
I'll post screen recording on it shortly.
now I start thinking the content of the notes is somehow related.
I've modified the content to "abcde", and then restarted, and now the issue is reproducible here.
okay, reproducible with the steps in comment #8, with the notes account that has non-default notes content, on macOS, with 61.0a1 (2018-03-19) (64-bit).
I'll investigate.
so, actually you don't have to sign into sync account.

here's reduced steps:
  1. Run `mozregression --launch 20180315100042` on macOS
  2. Open about:config and turn xpinstall.signatures.required to false
  3. Open about:addons
  4. Drag and drop firefox_notes-3.1.0.xpi to about:addons, and install it
  5. Modify the content of notes to "abcde"
  6. Close and reopen the sidebar, by clicking the "Show sidebars" toolbar button twice
  7. Right click in the bottom toolbar
If I comment out the body of sidebar/index.html, the menu is opened for everywhere in the sidebar,
so I think that's the default context menu, and sidebar is somehow disabling it inside initialization,
and possibly it's delayed for some reason and the menu is not disabled?
Blocks: 1193394
kmag, do you know how the sidebar context menu is handled, and when/how it's disabled or replaced?
Flags: needinfo?(kmaglione+bmo)
Summary: A context menu is wrongly displayed if the Notes bottom toolbar is right clicked when you are logged in after the sidebar is reopened → A context menu is wrongly displayed if the Notes bottom toolbar is right clicked when you are logged in to account that has non-default note after the sidebar is reopened
(In reply to Tooru Fujisawa [:arai] from comment #16)
> kmag, do you know how the sidebar context menu is handled, and when/how it's
> disabled or replaced?

As far as WebExtensions go, we don't override the sidebar of context menus at all. It should get more or less the normal content area context menu, though admittedly with a bit of indirection:

https://searchfox.org/mozilla-central/rev/877c99c523a054419ec964d4dfb3f0cadac9d497/browser/base/content/webext-panels.js#31-57

I'd imagine that if the Notes extension disables the normal context menu, it does so using a contextmenu event handler.
Flags: needinfo?(kmaglione+bmo)
Thank you for the pointer :D

(In reply to Kris Maglione [:kmag] (long backlog; ping on IRC if you're blocked) from comment #17)
> I'd imagine that if the Notes extension disables the normal context menu, it
> does so using a contextmenu event handler.

Indeed, it was using contextmenu event handler, and if there's non-default notes content,
#footer-buttons is not there when running the following code:

> function customizeEditor(editor) {
>   var mainEditor = document.querySelector('.ck-editor__main');
> 
>   // Disable right clicks
>   // Refs: https://stackoverflow.com/a/737043/186202
>   document.querySelectorAll('.ck-toolbar, #footer-buttons').forEach(function (sel) {
>     sel.addEventListener('contextmenu', function (e) {
>       e.preventDefault();
>     });
>   });

that results in not-preventing default context menu for footer buttons.


then, looks like customizeEditor is called inside Promise resolution handler,
so surely it will be affected by bug 1193394 change.

>         ClassicEditor.create(_this.node, _editorConfig2.default).then(function (editor) {
>           _this.editor = editor;
> 
>           (0, _editor.customizeEditor)(editor);

I'm not sure what actually it's racing against tho...
(the footer buttons are created with React things :P

anyway, I think it should wait for footer buttons rendering before running customizeEditor
I wonder Notes developers have been aware of this issue.
Flags: needinfo?(aswan)
Closing in favor of the github issue from comment 20
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(aswan)
Resolution: --- → WORKSFORME
Product: Toolkit → WebExtensions
Flags: needinfo?(bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: