The misery of having one-off searches in URL bar comes from a file
in a "zip" file omni.ja
.
To disable the feature we can edit the file, with the risk of rendering Firefox unusable.
Make a backup of the file first.
cd /Applications/Firefox.app/Contents/Resources/browser/
cp omni.ja omni.ja_backup
Unzip the file and edit
cd ~/temp
cp /Applications/Firefox.app/Contents/Resources/browser/omni.ja .
unzip omni.ja
rm omni.ja
vi modules/SearchOneOffs.jsm
// we add a flag to see whether it is from URL bar or search bar
constructor(container) {
this.container = container;
this.noOp = container.parentElement.classList.contains("urlbarView");
this.container.appendChild(
...
// and return an empty list for search engines when it is in URL bar
async getEngines() {
if (this.noOp) { return []; }
if (this._engines) {
return this._engines;
}
And repack and overwrite
zip -qr9XD omni.ja *
cp omni.ja /Applications/Firefox.app//Contents/Resources/browser/omni.ja
Finally, purge the caches for our hack to take effect.
/Applications/Firefox.app/Contents/MacOS/firefox-bin -purgecaches
The above is done in MacOS and on Firefox 81.0.
For earlier versions that file is in
chrome/browser/content/browser/search/search-one-offs.js
.
The same change should work on Linux and Windows as well,
but I am not sure about the file locations and the commands to use.
Feel free to comment below.
I'm not taking responsibilities if you break any stuff.
Ok I managed to repack it! Could you please explain where exactly the code goes? I found the first part in the beginning. But what about second part?
upd: Forget it found other way https://www.reddit.com/r/firefox/comments/k03coh/how_to_really_remove_oneoffs_search_engines/