为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

"Open Link in New Tab" item JUMPS AROUND on Context Menu!

  • 8 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 Slouch

more options

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!

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!
已附加屏幕截图

由Slouch于修改

被采纳的解决方案

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;
}
定位到答案原位置 👍 1

所有回复 (8)

more options

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.

more options

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.

more options

选择的解决方案

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;
}
more options

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.

由jscher2000 - Support Volunteer于修改

more options

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 :)

more options

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).

more options

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
more options

Thank you cor-el. Good information to know :)