![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
"Open Link in New Tab" item JUMPS AROUND on Context Menu!
In FF v60, I noticed some strange behavior with the context menu when right-clicking on a link.
The "Open Link in New Tab" menu item arbitrarily jumps around on the menu with each new tab opened, even though I have CSS that specifically sets it as the second menu item.
Sometimes it will become the last item on the menu, or the third to last item, or third from the top. It literally changes places at random! See attached screen images.
Things worked fine in v59, but v60 presents this very puzzling issue.
Here is the CSS from my userChrome.css file to make "Open Link in New Tab" the second menu item...
#contentAreaContextMenu > * { -moz-box-ordinal-group: 2; } #context-openlink { -moz-box-ordinal-group: 1 !important;} #placesContext > * {-moz-box-ordinal-group:4;} #placesContext_open\:newwindow {-moz-box-ordinal-group:1!important;} #placesContext_open\:newtab {-moz-box-ordinal-group:2!important;} #placesContext_open {-moz-box-ordinal-group:3!important;}
Why is the context menu continuously rotating the "Open Link in New Tab" item to different positions?
Quite frustrating when years of "muscle memory" has trained me to look for this as the second menu item, and now my custom CSS no longer holds it in place :-)
Thanks!
Muudetud
Valitud lahendus
Slouch said
The "Open Link in New Tab" menu item arbitrarily jumps around on the menu with each new tab opened, even though I have CSS that specifically sets it as the second menu item.
Very funny screenshots; I definitely cannot explain it.
However, you do not have a specific group level for Open Link in New Tab on the content area context menu. Since it apparently likes to roam, try this:
/* Default for items at the main level of context menu */ #contentAreaContextMenu > menu, #contentAreaContextMenu > menuitem, #contentAreaContextMenu > menuseparator, #contentAreaContextMenu > menugroup { -moz-box-ordinal-group: 3; } /* Open Link in New Window FIRST */ #context-openlink { -moz-box-ordinal-group: 1 !important; } /* Open Link in New Tab SECOND */ #context-openlinkintab { -moz-box-ordinal-group: 2 !important; }Loe vastust kontekstis 👍 1
All Replies (8)
What's with the stray characters of *, >, and / sprinkled throughout the code?
Typically the two characters * & / are used in pairs for the purpose of inserting a comment for line of code; open and close notations for comments depending upon their order. Try getting rid of those 4 stray characters and see if that batch of code is read more consistently; it may be confusing Firefox resulting in unpredictable behavior.
Thanks for your reply, the-edmeister.
I have removed those stray characters you mentioned, and now have the following CSS...
#contentAreaContextMenu { -moz-box-ordinal-group: 2; } #context-openlink { -moz-box-ordinal-group: 1 !important;}
#placesContext {-moz-box-ordinal-group:4;} #placesContext_open:newwindow {-moz-box-ordinal-group:1!important;} #placesContext_open:newtab {-moz-box-ordinal-group:2!important;} #placesContext_open {-moz-box-ordinal-group:3!important;}
I must have found the previous code online (stray characters and all). Funny thing is, it worked fine until version 60.
The context menu now appears with the items in their default order (see image). I don't think my code is having any effect. Open Link in New Tab is the first item, and I would like it to be second.
Can you possibly suggest some code to accomplish that?
Regards.
Valitud lahendus
Slouch said
The "Open Link in New Tab" menu item arbitrarily jumps around on the menu with each new tab opened, even though I have CSS that specifically sets it as the second menu item.
Very funny screenshots; I definitely cannot explain it.
However, you do not have a specific group level for Open Link in New Tab on the content area context menu. Since it apparently likes to roam, try this:
/* Default for items at the main level of context menu */ #contentAreaContextMenu > menu, #contentAreaContextMenu > menuitem, #contentAreaContextMenu > menuseparator, #contentAreaContextMenu > menugroup { -moz-box-ordinal-group: 3; } /* Open Link in New Window FIRST */ #context-openlink { -moz-box-ordinal-group: 1 !important; } /* Open Link in New Tab SECOND */ #context-openlinkintab { -moz-box-ordinal-group: 2 !important; }
the-edmeister said
What's with the stray characters of *, >, and / sprinkled throughout the code?
They might not be stray characters.
- The > indicates a parent-child relationship between two selectors. (MDN)
- The * is a wildcard that matches everything. (MDN) I think these are considered to hurt performance, so I try not to use them.
- I don't know what the \ does, but it may mean that the : is a literal part of the id rather than having its usual significance (for example, in :hover, :not() or other pseudo-class or pseudo-element). Although, I don't think : is legal in an id.
Muudetud
Thank you jscher2000.
So far your suggested code is working.
I guess I hastily grabbed someone else's malformed code a couple of years back, which miraculously worked until the current version.
Hopefully the menu item stays put now :)
Glad to hear it's stable for you.
Note: I only replaced the first two lines of your rules. The others are related to the context menu for bookmarks (and maybe also history).
The backslash in places IDs to escape the ':' is quite normal for #placesContext IDs.
#placesContext_open\:newtab #placesContext_openContainer\:tabs #placesContext_openLinks\:tabs #placesContext_open\:newwindow #placesContext_open\:newprivatewindow #placesContext_openSeparator #placesContext_new\:bookmark #placesContext_new\:folder #placesContext_new\:separator
Thank you cor-el. Good information to know :)