autocomplete-richlistitem order no longer works
For a few months I have been using a userChrome.css customisation which displayed a URL at the beginning of each drop down autocomplete result for the URL Bar (normally a useless page title is displayed).
Here is the thread where I got the script from (thanks for your help, jscher2000): https://support.mozilla.org/en-US/questions/1256581
Today I upgraded to Firefox 68 and it stopped working. Autocomplete results now display website title first, which is completely unreadable and pointless.
My userChrome.css definitely works, because if I add the following line at the end:
- { color: red !important; }
then the text becomes red.
Unfortunately changing the order of autocomplete results so that the URL is first, has no effect.
Here is the entire content of my userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ .ac-url-text { color: black !important; font-size: 12px !important; } .ac-url-text[selected="true"] { color: white !important; } .ac-site-icon { display: none !important; } /* Site Identity Button, EV: hide label */ #identity-box #identity-icon-labels {display:none !important} #identity-box:hover #identity-icon-labels {display:-moz-box !important} /* Squash tab bar to 1px tall and hide the tabs */ #TabsToolbar { height: 1px !important; min-height: 1px !important; max-height: 1px !important; } #TabsToolbar .tabbrowser-tab { display: none !important; } #PopupAutoCompleteRichResult { margin-left: -9px !important; } #PopupAutoCompleteRichResult .autocomplete-richlistbox { width: auto !important; max-width: 78vw !important; } /* Oldbar flex layout based on https://userstyles.org/styles/131235/firefox-autocomplete-prioritize-url used with permission, new errors my own */ .autocomplete-richlistitem[type="favicon"], .autocomplete-richlistitem[type="bookmark"], .autocomplete-richlistitem[type="switchtab"] { display: flex; } .autocomplete-richlistitem[type="favicon"] .ac-url, .autocomplete-richlistitem[type="bookmark"] .ac-url, .autocomplete-richlistitem[type="switchtab"] .ac-url { order: 1; display: block !important; /* Force URL for Switch to Tab */ } .autocomplete-richlistitem[type="favicon"] .ac-separator, .autocomplete-richlistitem[type="bookmark"] .ac-separator, .autocomplete-richlistitem[type="switchtab"] .ac-separator { order: 2; -moz-margin-start: 2px; -moz-margin-end: 4px; } .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-separator { visibility: hidden !important; -moz-margin-start: 0; -moz-margin-end: 0; } .autocomplete-richlistitem[type="favicon"] .ac-title, .autocomplete-richlistitem[type="bookmark"] .ac-title, .autocomplete-richlistitem[type="switchtab"] .ac-title { order: 3; } .autocomplete-richlistitem[type="switchtab"] .ac-action, .autocomplete-richlistitem .ac-tags { order: 4; } /* Overall Layout of the "Oldbar" style at 65/35 */ /* Drop-down width */ #PopupAutoCompleteRichResult { max-width: 1000px !important; } /* Space allocated to URL and title */ #PopupAutoCompleteRichResult .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-url-text { min-width: calc(0.65 * (1000px - 200px)) !important; max-width: calc(0.65 * (1000px - 200px)) !important; } #PopupAutoCompleteRichResult .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-title-text { min-width: calc(0.35 * (1000px - 200px)) !important; max-width: calc(0.35 * (1000px - 200px)) !important; } .autocomplete-richlistitem .ac-type-icon, .autocomplete-richlistitem .ac-site-icon, .autocomplete-richlistitem .ac-tags { margin-top: 6px; } /* Font-sizes */ #PopupAutoCompleteRichResult .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-url, #PopupAutoCompleteRichResult .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-title, #PopupAutoCompleteRichResult .autocomplete-richlistitem:not([actiontype="searchengine"]) .ac-action { font-size: 14px !important; } .autocomplete-richlistitem .ac-url, .autocomplete-richlistitem .ac-action { margin-top: 4px; } /* Remove Page Actions Menu */ #pageActionButton { display: none !important; } /* Reduce height of URL Bar drop down */ #PopupAutoCompleteRichResult .autocomplete-richlistitem { height: 26px !important; min-height: 26px !important; }
Променено на
Всички отговори (6)
The layout of this drop-down list has changed completely and is now an HTML #urlbar-results panel The actual list is in a div#urlbarview-results and each item is a numbered div#urlbarview-row-xx item that consists of spans.
So what should I modify to get the desired behaviour?
I don't know what all your code is doing. You can look at the tool on this website.
The tool generates practically the same script as I had, it uses the obsolete "autocomplete-richlistitem".
Is there any sample script showing how to change the new layout of the URL bar drop down rows? I can see the code in UrlbarView.jsm, but I have no idea what to write to userChrome.css to get rid of the "urlbarView-title" and "urlbarView-title-separator" and leave just "urlbarView-secondary urlbarView-url".
The tool includes urlbarview code (do a search for urlbar), but still has a lot of old code.
See this CSS file:
display:flex code is beyond this forum and you can try Reddit.
ralphos said
The tool generates practically the same script as I had, it uses the obsolete "autocomplete-richlistitem".
Could you compare again? For example, do you get the new selectors after the old ones (this user style is supposed to be backwards and forwards compatible, it isn't limited to Firefox 68):
/* Oldbar flex layout based on https://userstyles.org/styles/131235/firefox-autocomplete-prioritize-url used with permission, new errors my own */ .autocomplete-richlistitem[type="favicon"], .autocomplete-richlistitem[type="bookmark"], .autocomplete-richlistitem[type="switchtab"], #urlbarView-results .urlbarView-row { display: flex; }
Also, bear in mind that the old drop-down was built with XUL and the new drop-down is primarily HTML. If you keep the XUL namespace line at the top of your userChrome.css file, my rules for HTML elements will be ignored. Yes, there is a way I can modify all the selectors to work around that, but it's faster if you remove the @namespace.