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.
Hi! I'm trying to do this on Windows through total commander/code editor. And it won't allow me to rewrite file. Is it different on Mac? Do you think it's windows problem or i should do it with cmd?