Solved Allow hiding the search command from address bar dropdown
-
@bonetone said in Address Bar Search: Remove "Search Google":
Actually, there is a deeper bug in here, unrelated to the Search Engine thing... I'm doing some investigation and will file it later tonight.
Did anything become of this?
EDIT: just did some reading on this. It seems using the display:none css only hides it, but the element is still technically there and actionable in the right situation (key presses for this). To remove it completely it needs to be removed from the DOM, which as i understand it must be done via JS.
I think that is probably well beyond my knowledge.
-
I thought it was called "Omnibox"? Which can be used concurrently with the search box?
-
it is and it can, but not everyone wants to have their hand held every step of the way.
I don't want to think about "i'm doing a search - i need to go to the search box", when entering a term into the omnibox gives the same outcome.
And following that, because i know that entering a term will automatically become a search with the default search engine on pressing enter, I don't need the UI explicitly showing that. It just leads to extra clutter instead of showing me more handy things like previously typed addresses/bookmarks etc.
No ones saying it shouldn't be there, just to have an option to remove it like there is for bookmarks/previously typed/history etc.
-
@7twenty said in Address Bar Search: Remove "Search Google":
Did anything become of this?
EDIT: just did some reading on this. It seems using the display:none css only hides it, but the element is still technically there and actionable in the right situation (key presses for this). To remove it completely it needs to be removed from the DOM, which as i understand it must be done via JS.
I think that is probably well beyond my knowledge.
Hey, sorry for the slow reply. I fell ill and spent a week on the couch, and then we had out-of-town guests staying at our house. Being ill combined with catching up on work & hosting consumed all my time & energy. I have only been on the forum to read a couple posts but never had enough free time or strength to write or do any work on the browser.
I'm still a little behind with my work, but I'm also catching up on Vivaldi and will hopefully get to this soon... I'll prioritize it on the list of things I want to do with Vivaldi.
-
@harrisonchu88 said in Address Bar Search: Remove "Search Google":
I thought it was called "Omnibox"? Which can be used concurrently with the search box?
Searching in the address bar, or the omnibox if you prefer, can be disabled in the settings. I do this. Some people disable it for privacy reasons, to prevent sending the URLs they're typing to a search engine. I also like to reduce the clutter & speed things up. There are a few checkboxes in the settings that allow the user to choose what types of things will be displayed in the suggestions dropdown. I just do my searches from the search bar.
@7twenty said in Address Bar Search: Remove "Search Google":
it is and it can, but not everyone wants to have their hand held every step of the way.
Right, and that's why we all love Vivaldi. It's numerous options let users configure the browser to match their preferences.
I don't want to think about "i'm doing a search - i need to go to the search box", when entering a term into the omnibox gives the same outcome.
And I'm the opposite, see above. It's just muscle memory for me to hit my keyboard shortcut before I do a search, or type an address. I don't really think about it. Since I'm going to be using the keyboard to type my search or URL, I don't use the mouse to activate either field. Both keyboard shortcuts are similar, my right hand just hits either the letter K or L after my left has held down the letter D (which is a dual- function key for me, holding D sends a held Ctrl). All 3 are home keys, so I'm instantly ready to type as soon as the address or search field is activated.
And following that, because i know that entering a term will automatically become a search with the default search engine on pressing enter, I don't need the UI explicitly showing that. It just leads to extra clutter instead of showing me more handy things like previously typed addresses/bookmarks etc.
And to me, overloading the address field is clutter. Not having search terms in the address field's dropdown makes it cleaner and provides more room for previously typed addresses or history; and the search field would only show search suggestions (if I had them turned on).
No ones saying it shouldn't be there, just to have an option to remove it like there is for bookmarks/previously typed/history etc.
Wait, are you thinking about disabling the list? Because you can already do that in the search settings. This request is to remove a static item from that list: "Search <EngineName>". That item is similar to the "Typed" or "History" list items, which cannot be removed. Currently, search is on parity with bookmarks/previously typed/history -- actually it's got a little more functionality. Where you can remove the search list just like the others, or you can remove it unless you use a search engine nickname -- using a nickname would make the search suggestions appear.
And, actually, I think the OP's request has been implemented (at least partially). I just turned on search suggestions in the address field, and when I press the down arrow key it immediately goes to the first suggestion, although the text list item is still there.
Can you test again? I have DuckDuckGo set as my default engine, and actually Google's suggestions won't work for me at the moment as I have some rather strict restrictions on that domain right now. I can probably test tomorrow night or the next day, but it'll require punching a temporary hole in some of my security configs. With DDG, instead of "Search Google" it reads "Suggestions", however, the down arrow key goes immediately to the first suggestion. When testing Google, I don't get suggestions for the reason above, but the down arrow key does skip over the "Search Google" line and lands on my search term with one key press.
So, although there is still the additional line there, in terms of using it, you no longer have an unnecessary key press to skip over that line. At least on my end with the latest version.
-
@bonetone said in Address Bar Search: Remove "Search Google":
This request is to remove a static item from that list: "Search <EngineName>". That item is similar to the "Typed" or "History" list items, which cannot be removed.
Exactly, this item as shown in the OP image, being the title "Search Google" and the search term "preside".
The search suggestions are not related to this request and can already be removed via options.
The equivalent option would be the addition of "Include Search term in dropdown" in the addressbar options to show/hide that section as it does for the others:
As stated previously, the mod does exactly what is required (hides the elements), except that when accessing the dropdown using a keyboard the cursor doesn't jump to the next showing section (suggestions as shown in the OP), but disappears as it's highlighting the hidden element.
Note this is using 2.8 stable. If there have been changes in any snapshots since, then i'm unaware of how the mod affects it.
-
@7twenty said in Address Bar Search: Remove "Search Google"
Note this is using 2.8 stable. If there have been changes in any snapshots since, then i'm unaware of how the mod affects it.
2.8 is old, I'm not using the snapshots, 2.9 is the latest, actually, I think we're on like the 3rd patch release of the 2.9 minor version. I'm currently running:
Vivaldi 2.9.1705.41 (Stable channel) (64-bit)
Revision ce637bfd730e6b2e549bf8def38f849e1a26bd3b
OS Windows 10 OS Version 1909 (Build 18363.476)
PS - Sorry for my confusion. It's been a couple weeks since I've looked at this stuff and without having any suggestions from Google I wasn't able to visually compare the two engines.
Though, it probably makes sense to have the checkbox for the search term on the search settings page where the checkbox is to remove the search suggestions.
As for the mod, I'm not using it since I don't search in the address bar, but I recall the behavior from when we first created it. Implementing it in JS instead of CSS would probably allow removing it, rather than hiding it. That would likely solve the extra key press issue. We already know the selectors to target it, so it shouldn't be too much work. I bet the folks in the mod category could whip up a solution rather quickly, when they've got the time. Unless this approach has already been considered and found lacking.
I need to get some rest, but I'll take a look hopefully tomorrow evening. But those folks who have already released several mods are better at JS than I.
-
For those who use several search engines in Vivaldi, the 'Search with ......' information is not useless. So you know which search engine is active (Search Startpage, Wikipedia, Mojeek, Internet Archive, Wolfram Alpha, etc.)
-
@bonetone said in Address Bar Search: Remove "Search Google":
2.8 is old,
My bad, it's actually 2.9 stable. Not sure where the 2.8 came from.
Have updated the thread in the mod forum asking about making it JS.
@Catweazle said in Address Bar Search: Remove "Search Google":
For those who use several search engines in Vivaldi, the 'Search with ......' information is not useless.
I understand that, and the reason why it's being requested an option along with the every other element that is shown in the addressbar dropdown.
It seems odd, we'll give you options to enable/disable everything else in the dropdown... but this one. Almost seems like an oversight it's that odd.
For me having the favicon show in the addressbar when typing the nick is enough to show what i'm searching with. Although there was mention that it may not always be enough depending on how elaborately your searches are set up. But again, that's why as an option along with typed/bookmarks etc.. it makes sense.
-
I do not get this ussue using the latest snapshot:
Vivaldi 2.9.1719.3 (Official Build) (64-bit)
Revision 0bbda18d637cc31f12e9df6266970be481af3826
OS Windows 10 OS Version 1903 (Build 18362.476)Also I have deleted google from my available search engines and use the Settings below:
-
@greybeard said in Address Bar Search: Remove "Search Google":
I do not get this ussue
This is about searching from the address bar, not using the search box as you have enabled shown above.
Enable Search in Address Field and you'll see the what's going on.
-
@7twenty Yep, I get you.
But you are using a Mod, correct?
I am not. -
@greybeard said in Address Bar Search: Remove "Search Google":
But you are using a Mod, correct?
Yes, but the mod doesn't change the way the keyboard works with the dropdown.
Mod disabled:
Enter search term
Down goes to Search [search engine]
Down again goes to bookmarks/typed whatever is thereMod enabled:
Enter search term
Down goes "nowhere", but is actually highlighting the hidden Search [search engine]
Down again goes to bookmarks/typed whatever...Ideally the first down press should go straight to bookmarks/typed whatever...
Might seem a lot of effort for one keypress, and there's a few things i'd prefer fixed/added before this, but this seems one of the simpler ones.
Might have to really get stuck into learning more JS and see what i can come up with.
-
Btw, I thought I'd try asking the AHK team for you, but...
-
I just had a thought, try implementing the mod this way instead of using just display: none. I haven't had any time for myself, so haven't tested it yet, but I wanted to quickly post in case it helps. Let me know if there is any change in the behavior.
.OmniDropdown-Collection:first-child { visibility: collapse; width: 0; margin: 0; height: 0; }
Another thought, isn't there actually 2 lines shown between the address field and the header for search suggestions? The first reads "Search Google" and the next shows the search term, if I recall without being at a computer.
If the above code doesn't do the trick, then perhaps the selector needs to be modified, such that both the first & second child match. Instead of the
:first-child
pseudo-class use thenth-child(n)
pseudo-class to select both lines. I'd only try this if the above code doesn't work, otherwise this might remove the first suggestion.Something like:
.OmniDropdown-Collection:nth-child(1), .OmniDropdown-Collection:nth-child(2) { // insert same code as above here }
Hope this helps.
Edit: it would be good if someone who knows CSS reviews my code in this post. I'm half asleep writing this, but I need to go to bed and deal with the absentee contractor tomorrow morning. Thanks.
-
Option #1 doesn't seem to be any different to the original mod using just
display:none
Option #2 makes things worse. It's hiding the 2nd group of items, bookmarks in my testing. in the dropdown. So you just end up cycling through those in the address bar with no visual clue where they're from.
@bonetone said in Address Bar Search: Remove "Search Google":
isn't there actually 2 lines shown between the address field and the header for search suggestions? The first reads "Search Google" and the next shows the search term
Correct.
.OmniDropdown-Collection
is the selector that contains both.
.OmniDropdown-Label
is the search label,
.omni-clickable.OmniLinkItem.OmniLinkItem--SingleValue
is the next line with the text to be searched.Unless there's someone that knows something more, i'm thinking that JS is the only way to make this happen correctly and remove the selector completely.
EDIT: done some digging and clarified some bits.
-
This page describes how to use JS to remove an element from the page. It points out that it requires using the parent and selecting the child, but we're already doing that with the CSS so no extra work there. But it looks like just a short couple lines of code will get the job done.
If you don't already know how to add JS mods to the browser, the pinned post in the Modifications category explains it. You'll have to reapply the mod after every upgrade so make sure to keep a copy of your code in some other location.
-
I actually found my way to that site a while back. That's how i got the code posted here.
Have been playing around with this, and now it's making more sense in what it does, and how it works....
setTimeout(function wait() { const thingToRemove = document.querySelectorAll('.OmniDropdown-Collection')[0]; if (thingToRemove != null) { thingToRemove.parentNode.removeChild(thingToRemove); } else { setTimeout(wait, 300); } }, 300);
except:
1/ It only works the first time the dropdown is shown, then fails after that. So i'm guessing that's because it's being called bysetTimeout(function wait()
. So needs it's own function and to be called when the dropdown is created.
2/ It still seems to do the same as the original mod, which i don't understand.Regardless, it's been interesting to play around with. It's all making more sense and have been learning to use the Devtools console more instead of updating the .js file and restarting the browser.
So this also got me thinking. We know how to hide the element, which is simple and works. Why can't we just make the
.omni-clickable.OmniLinkItem.OmniLinkItem--SingleValue
a label which isn't selectable and just hide that?Will start looking into that and see if that's a possibility.
-
@bonetone said in Address Bar Search: Remove "Search Google":
... You'll have to reapply the mod after every upgrade so make sure to keep a copy of your code in some other location.
I've no knowledge on .js scripts, but just out of curiosity, is there no way to use, e.g., the custom browser feature to call on a pre-defined script in-line? From what I've seen, the feature works similar to hotstrings and gets applied as a prefix -- in place of whatever string gets defined as a shortcut -- when the search is executed, right? Since .js can be directly invoked through the omnibox, assuming this would work, wouldn't the script be saved persistently?
-
i don't even use suggestions at all, so removing this field would create mayhem