How to get firefox select search engine with flag like chrome does - firefox

In Chrome browser, there is the possibility to define flags for selecting a specific search engine, depending on what you want to use for a current search. In your address bar, you can type for example
w my search term
By typing the w + space, chrome selects Wikipedia as search engine for "my search term". (Of course, having configured that w means Wikipedia.)
Is there a way to get this behaviour in Firefox, too?
To avoid misunderstandings: I know how to set a default search engine in Firefox, but I want to select it ... let's say ... 'dynamically', without the detour via calling the search engine's webpage before and typing in there.
Thanks!

In Preferences -> Search -> Search Shortcuts you can specify a keyword, w in your example.
If you want to add more wikipedia languages, go to wikipedia in that language, search form something and in the results page (doesn't work if it directly redirects to the article) click the ... in the address bar. You should see an Add Search Engine option.

Related

Instead of scrolling, how to time-save by search for text in URL including its subpages without knowing them? like Word Find and GoTo tool?

Instead of mouse-scroll and Keyboard Paging to find subpage containing certain text , is it possible to search for text like Word Find Tool which highlights found paragraphs and then use GoTo to jump to desired subpage ?
example of such URL is
https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/clean-install-windows-10-11-2023/1c426bdf-79b1-4d42-be93-17378d93e587?messageId=87dd4fe8-4cd0-4e7a-b9ca-569e1f107e26&page=6
No Edge Extension that is approved by my organization
Chrome Extensions that is approved by my organization
No app that is approved by my organization to Print all Subpages of a URL

Firefox location bar autocomplete: suggest most visited full URL, not host

However many times you type (or otherwise visit) a particular URL at a host, e.g. www.domain.com/foo/bar Firefox suggests the bare host, www.domain.com first if you type the first few letters, e.g. dom in the location bar.
Is it possible to change this behavior to match Chrome, i.e. suggest the highest ranked full URL, without forcing the URL of the host to be the top choice?
Here are steps to reproduce the behavior I'd like to change: On a fresh install/profile of Firefox 59 with no history:
type a full URL that is not simply the domain of a site, e.g. stackoverflow.com/questions
hit enter to load the URL, then close the tab
type the first few letters of the URL, e.g. stac
The first suggestion is stackoverflow.com (see picture). This takes you to stackoverflow.com, not stackoverflow.com/questions. To get the full URL you actually typed, you have to arrow down to the next suggestion (or further if you have search suggestion enabled).
To be clear, stackoverflow.com/questions is just an example. The problem is that the first suggestion is the highest matching host, not the highest matching full URL for all hosts and URLs.
This also annoyed me a lot - in the end I found a workaround, telling firefox to suggest only items from the bookmarks list.
This way, I bookmark the long addresses I want to appear in the list, and the short ones disappear.
The settings are (version 75.0) in about:preferences#privacy, address bar, uncheck browsing history.

How to specify the Keyword for search engines in Firefox?

It keeps bothering me that I cannot manage the Keyword for "One-click search engines". The keyword could be displayed as follows in Firefox 38.0.1
Through the help link, I found ways to add/hide/remove search engines. However, it did not give any suggestion on how to modify the search engine.
The practical motivation for me to learn how to change the keyword is that:
Firefox cannot sync "search engines" across different installations. Only bookmarks and add-ons could be synced, so far.
I am using Vimperator with Firefox, where pressing o (or t) followed by TAB, then keyword for search engine, will enable the finishing a search query sequence. Example:
:open google happy 2015
will launch a Google result page searching for "happy 2015".
So, the syntax is: ":open keyword search-pattern".
Can anyone tell me how to change the "keyword" of a search engine? Or, give instruction on how to create a search engine of my own? (either on the web or locally loaded is fine.)
To edit the keyword for a search engine, double-click on the search engine's entry, or highlight it and press F2.
Solution in short, as kindly offered by Brandon Parmenter, goes as follows:
:bmark http://example.com/search#q=%s -keyword=example
Start of the longer/older answer
Though the solution inspired by the following link does not change the entries for search engine, it does offer a fully functional keyword feature.
wikiHow:How to Add a Custom Search Engine to Firefox's Search Bar
Unlike what has been suggested in the external link, no further add-on is needed. The following steps will complete the definition of a search-keyword:
Go to the page on which one can search. (Either google.com, or github.com, or whatever)
Right click the search box (through which one can type search inquiry) and select "Add a Keyword for this search"
Define the keyword and press enter
This is not defining a search engine, but rather a search-keyword. Keywords defined in this way is stored as a Bookmarks entry.
So far, it is yet unclear how would conflicting keywords between search-engines-keywords and one we just defined should be resolved. Hopefully, since Firefox is syncing Bookmarks items, search-keyword may be synced to other installations.
Since the question to modifying the search-engine-keyword is yet unsolved, I will not accept my own answer.
Additionally, if one would be interested to look into the Bookmark entry, %s is the "place-holder" in the "Location" field of such bookmark that will be subsituted by whatever one would like to search.
To programatically change the keyword of a search engine you can do it like this:
var allEngines = Services.search.getEngines()
for (var i=0; i<allEngines.length; i++) {
var currentEngine = allEngines[i];
console.log('name of current engine:', currentEngine.name);
var currentKeyword = currentEngine.alias; // is null if no current key word
}
To change the keyword programtically just set currentEngine.alias
Here is a variable viewer in browser console of allEngines you see its an array and each entry is like this, in this image here one entry is expanded:
If you know the name you can just get the engine by name with var currentEngine = Services.search.getEngineByName('Bing')

How to do a simple search in Firefox DevTools' Inspector tab?

I'm using the Firefox DevTools and I'm using the Inspector tab, in which it displays the HTML tree.
When I use the Search HTML feature, it only searches tags. So suppose I have this:
<div class="lol">textinsidediv</div>
And when I search for 'div', it returns the <div> accordingly. However, if I search for 'textinside' it doesn't match the text inside the content despite the fact that it's starting right there.
My question: How can I search for any arbitrary string within this HTML tree?
(In contrary Firebug performs a simple text search just as expected.)
The search in the Inspector panel of the Firefox DevTools allows to search for text content since Firefox 45 (see bug 835896).
Btw. since Firebug 2.0 you're also able to search in the HTML panel using CSS selectors (additionally to the plain text search).
It is not some really useless html tag search, it actually searches CSS selectors (same as what you use with css, querySelector in Javascript, or jQuery selector)
So you can search #id, go through all elements of a certain class by searching .class, you can even search for all elements with attribute including text, for example [class*="o"] should give all elements with letter o in class attribute. This is helpful for what designers/developers want to find - to find text, you can Ctrl+F within the page, then right click, inspect element.
A good idea is to Copy Inner HTML but even better is Edit As HTML. That brings up an in-place panel displaying the full text, and it can be searched with Ctrl+F or cmd+F.
Ctrl+G to find next, Ctrl+Shift+G to find previous.
Workaround: in the inspector, right-click the outermost tag, then click 'Copy Inner HTML'. Paste in a word processor and search there.
This is now fixed as of FireFox 45...
https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML#Searching
See answer.
As an alternative to searching within dev tools...
Right click on the page anywhere
Select View Source
Within the source view you can easily perform a text search by doing a ctrl/f or cmd/f if on a mac.

Firefox bar to quickly find API docs

This question is related to this one
Tricks to Google for desired page quickly
Firefox can do some magic and bring exactly the required pages. E.g.
java 6 SimpleDateFormat
ruby doc rexml
But some times it fails giving a usual google results:
ruby rexml
And some times I whould like it to go to different a location:
javascript array slice
I see
http://www.w3schools.com/jsref/jsref_slice_array.asp
but whould like it to be
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/slice
How it works, btw? Where can I find all existing mappings, and how can I add/edit them? If they can be viewed/edited as text document, it whould be cool.
You can add YubNub as a search engine, (It's my default) and then your api docs of choice as a YubNub command if it doesn't exist already. I use it for Ruby all the time, e.g. rdoc String
You have several options:
Use the right-hand side search box where a search provider is available. MDC once had such a provider, but their search engine sucks big times. For example SO has such a provider. It's denoted by a shade of blue on the arrow right there.
Navigate to a particular search engine, right click the search field and "Add a Keyword for this Search". You may add "js" for example. In the future all you have to do is to type "js array slice" in the address bar and FF will bring you to the search results page of that particular search engine.
If there's no search engine on that site, use Google Custom Search, define engines as you like and then follow steps at point 2.
If you want to modify the built-in search engine for address bar, open a new tab, go to about:config and then search for "keyword.URL".
These aren't mappings, it's a Google Lucky search, isn't it?

Resources