New pref 'browser.bookmarks.openInTabClosesMenu = true' - unexpected behaviour using right-click context menu

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Blacklab
Board Warrior
Board Warrior
Posts: 1081
Joined: 2012-06-08, 12:14

New pref 'browser.bookmarks.openInTabClosesMenu = true' - unexpected behaviour using right-click context menu

Unread post by Blacklab » 2023-11-11, 14:22

Pale Moon 32.5.0 added a new preference 'browser.bookmarks.openInTabClosesMenu' (default true) as per Release Notes extract:
By user request, added a preference browser.bookmarks.openInTabClosesMenu (default true) to allow users to configure if they want to keep the bookmarks menu open if they open bookmarks from it in a new tab (by middle-clicking or Ctrl-clicking). The default behavior is to close the bookmarks menu like any other menu when an option in it is clicked.
Situation
The new preference works at expected and as stated when using "middle-clicking or Ctrl-clicking" to open a bookmark in a new tab.
The new preference does not work as expected when using the right-click context menu option 'Open in a New Tab' to open a bookmark.

When opening a bookmark using the 'Open in a New Tab' right-click context menu option the Bookmarks Menu does not auto-close as expected with preference 'browser.bookmarks.openInTabClosesMenu' set to 'true' (default). Instead, when using the right-click 'Open in a New Tab' the Bookmarks Menu remains open regardless of the new preference setting.

Tests
With new preference 'browser.bookmarks.openInTabClosesMenu' set to 'true' (default) in Pale Moon 32.5.0:

1. Test on a new profile of Pale Moon 32.5.0 on Win10:
Open a bookmark from Bookmarks Menu by selecting 'Open in a New Tab' from the right-click context menu:
  • EXPECTED RESULT - Selected bookmark opens in a new tab and the Bookmarks Menu closes automatically.
  • ACTUAL RESULT - Selected bookmark opens in a new tab and the Bookmarks Menu stays open.
2. Test on a new profile of Pale Moon 32.4.1 on Win10:
Open a bookmark from Bookmarks Menu by selecting 'Open in a New Tab' from the right-click context menu:
  • EXPECTED RESULT - Selected bookmark opens in a new tab and the Bookmarks Menu closes automatically.
  • ACTUAL RESULT - As expected.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: New pref 'browser.bookmarks.openInTabClosesMenu = true' - unexpected behaviour using right-click context menu

Unread post by Moonchild » 2023-11-11, 16:05

Yeah looks like I'll have to back that out for now. I spent quite some time looking into this but I don't see an easy solution because the whole bookmarks menu scripting is incredibly complex due to it being dynamically built, having a million and one different actions to activate bookmark menu items, and it not being simple to determine when a left-click on that menu item (obviously unmodified) should be treated specially. Menus are designed from the ground up to close when activated, and my solution was too shortsighted. This isn't the only behaviour I broke, by the way, so it can't stay in its current form.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite