Custom search, let us use certain variables?
-
I'd love to be able to include the current domain inside the custom search string. As it is now, the custom search string inserts the search query where the "%s" appears. For cases such as searching only within the current domain, it would be useful if I could write something like
https://www.google.com/search?q=%s%20site:%{domain}
Resulting in whenever I typed, for instance, "gss" (for google site search) it would restrict my search to whichever domain I was currently at. Currently I have to make one custom search for whichever site I want to do this. Another part is the current search field at the top corner, I think that would be better used if the default search for that was exactly the search I proposed above. I think everyone knows that you can basically just type what you need into the address bar, at least anyone using Vivaldi (we can assume it's mostly powerusers using V, right?). I did suggest this for Opera a good while back, but it was never implemented. -
Yes Vivaldi needs this domain variable feature at least for the given example to limit google search to current domain.
-
The format that Firefox uses for search plugins allows for custom variables, but I don't know how flexible it is. Can you access the current URL? Can insert JavaScript? Can you access the DOM of the current page?
-
This works when used in the address bar.
It does not work when used via right-clicking.
Does anyone know why?
javascript:location.href='http://www.google.com/search?q=site:'+window.location.hostname+' %s';
-
@rseiler Until someone figures out why the previous post doesn't work on a right-click, there's an extension that will:
https://chrome.google.com/webstore/detail/search-the-current-site/jliolpcnkmolaaecncdfeofombdekjcp?hl=en -
It's a pity Vivaldi still didn't add this feature.
-
Why not use a bookmarklet?
Make a new bookmark, with e.g.
Title:
Site Search
Address:javascript:location.href='https://www.google.com/search?q=site:'+window.location.hostname+' '+window.getSelection();
Nickname:ss
You can then select some text on a page, press either F2 or F8, type
ss
, and press Enter.