Join us and the lead editor of IRL, Mozilla's multi-award-winning podcast, for a behind-the-scenes look at the pod and to contribute your ideas for the next season, themed: "AI and ME." Mark your calendar and join our Community Call on Wednesday, Aug 7, 17:00–17:45 UTC. See you there!

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

css code to move paste & go to top of context menu please

  • 7 trả lời
  • 1 gặp vấn đề này
  • 4 lượt xem
  • Trả lời mới nhất được viết bởi BobFisk

more options

Hello,

Would anyone know if it's possible to use .css code to move paste & go to the top of the address bar context menu please?

Thank you.

Hello, Would anyone know if it's possible to use .css code to move ''paste & go'' to the top of the address bar context menu please? Thank you.

Giải pháp được chọn

Hello,

To move Paste & Go to the top, you must change the order of every item.


@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

.urlbar-textbox-container menuitem[cmd="cmd_undo"] {
  -moz-box-ordinal-group: 3 !important }

.urlbar-textbox-container menuseparator:nth-of-type(1) {
  -moz-box-ordinal-group: 2 !important }

.urlbar-textbox-container menuitem[cmd="cmd_cut"] {
  -moz-box-ordinal-group: 4 !important }

.urlbar-textbox-container menuitem[cmd="cmd_copy"] {
  -moz-box-ordinal-group: 5 !important }

.urlbar-textbox-container menuitem[cmd="cmd_paste"] {
  -moz-box-ordinal-group: 6 !important }

.urlbar-textbox-container menuitem[anonid="paste-and-go"] {
  -moz-box-ordinal-group: 1 !important }

.urlbar-textbox-container menuitem[cmd="cmd_delete"] {
  -moz-box-ordinal-group: 7 !important }

.urlbar-textbox-container menuseparator:nth-of-type(2) {
  -moz-box-ordinal-group: 8 !important }

.urlbar-textbox-container menuitem[cmd="cmd_selectAll"] {
  -moz-box-ordinal-group: 9 !important }
Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (7)

more options

I'm not sure CSS can do that. But you could try this add-on and see whether that lets you do what you need: Menu Editor :: Add-ons for Firefox.

more options

Hi jscher2000,

Thank you for your help.

I was hoping to avoid using any third-party addons. I've aleady come across userChrome.css code to customise the Context Menu and the Tab Context Menu, but am having trouble tracking down code to change the Address Bar Context Menu.

Thanks again.

more options

Giải pháp được chọn

Hello,

To move Paste & Go to the top, you must change the order of every item.


@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

.urlbar-textbox-container menuitem[cmd="cmd_undo"] {
  -moz-box-ordinal-group: 3 !important }

.urlbar-textbox-container menuseparator:nth-of-type(1) {
  -moz-box-ordinal-group: 2 !important }

.urlbar-textbox-container menuitem[cmd="cmd_cut"] {
  -moz-box-ordinal-group: 4 !important }

.urlbar-textbox-container menuitem[cmd="cmd_copy"] {
  -moz-box-ordinal-group: 5 !important }

.urlbar-textbox-container menuitem[cmd="cmd_paste"] {
  -moz-box-ordinal-group: 6 !important }

.urlbar-textbox-container menuitem[anonid="paste-and-go"] {
  -moz-box-ordinal-group: 1 !important }

.urlbar-textbox-container menuitem[cmd="cmd_delete"] {
  -moz-box-ordinal-group: 7 !important }

.urlbar-textbox-container menuseparator:nth-of-type(2) {
  -moz-box-ordinal-group: 8 !important }

.urlbar-textbox-container menuitem[cmd="cmd_selectAll"] {
  -moz-box-ordinal-group: 9 !important }
more options

Thanks Gingerbread_Man! I've been looking for this very thing myself but thought it should be included by default in Firefox.

I wanted the browser to automatically move Paste and/or Paste & Go to the top of the context menu, depending on what element you click on & only when data was detected in the clipboard. As 9 out of 10 times, if you're right clicking in the url bar (search box, form field, text area, etc) and have something copied, you're gonna want to paste it. Similar to how when you select text, the first choice is Copy followed by Select All.

I'll get around to filing a bug for the feature enhancement and see if I can get it to include pasting in the search engine box (Paste & Search) and text areas/text fields (Paste).

Gingerbread_Man, I'm guessing your code moves Paste & Go to the top of the context menu permanently. Is there a way to move it to the top of the menu only when it's active and not move it to the top when it's greyed out?

But on second thought, it doesn't bother me much if Undo is sitting underneath it sometimes. Guess I'm just curious if it can be done thru userchrome. Thanks.

more options

Noah_SUMO wrote:

Thanks Gingerbread_Man!

You're welcome.

Noah_SUMO wrote:

Is there a way to move it to the top of the menu only when it's active and not move it to the top when it's greyed out?

Here you go. I changed the separator back to its original order, because otherwise when Paste & Go is not available, the first menu item would be that separator.


@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

.urlbar-textbox-container menuitem[cmd="cmd_undo"] {
  -moz-box-ordinal-group: 2 !important }

.urlbar-textbox-container menuseparator:nth-of-type(1) {
  -moz-box-ordinal-group: 3 !important }

.urlbar-textbox-container menuitem[cmd="cmd_cut"] {
  -moz-box-ordinal-group: 4 !important }

.urlbar-textbox-container menuitem[cmd="cmd_copy"] {
  -moz-box-ordinal-group: 5 !important }

.urlbar-textbox-container menuitem[cmd="cmd_paste"] {
  -moz-box-ordinal-group: 6 !important }

.urlbar-textbox-container menuitem[anonid="paste-and-go"] {
  -moz-box-ordinal-group: 1 !important }

.urlbar-textbox-container menuitem[cmd="cmd_delete"] {
  -moz-box-ordinal-group: 7 !important }

.urlbar-textbox-container menuseparator:nth-of-type(2) {
  -moz-box-ordinal-group: 8 !important }

.urlbar-textbox-container menuitem[cmd="cmd_selectAll"] {
  -moz-box-ordinal-group: 9 !important }

.urlbar-textbox-container menuitem[cmd="cmd_paste"][disabled="true"] {
  -moz-box-ordinal-group: 5 !important }

.urlbar-textbox-container menuitem[anonid="paste-and-go"][disabled="true"] {
  -moz-box-ordinal-group: 6 !important }
more options
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

.urlbar-textbox-container menuitem[anonid="paste-and-go"] { -moz-box-ordinal-group: 0 !important; }

The customization files userChrome.css (interface) and userContent.css (websites) are located in the chrome folder in the user profile folder.

more options

Thank you very much for your help, Gingerbread_Man. I really appreciate it :) .

Thank you very much also to cor-el. You're code works too.

Best regards to you both.