為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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

  • 8 回覆
  • 1 有這個問題
  • 34 次檢視
  • 最近回覆由 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 :)