Change Librewolf's New Tab page with autoconfig withot overriding it's prefs

I tried following the Jangsoodlor guide, and with the help of a reddit post I was able to change the new tab page correctly, but Librewolf was a little weird, it put a home icon when there was none, a mozilla account button when there shouldn't be any, DuckDuckGo suggestions, and asked to save my password. Something was wrong.

Then I thought about the first pref in the autoconfig that said general.config.filename. Hmmm. Let's see the default configuration: librewolf.cfg! And librewolf.cfg is in /usr/lib/librewolf. It's overriding Librewolf's default configuration!

And in the last line of librewolf.cfg there was: A librewolf.overrides.cfg loader!

So, here's a guide on how to change Librewolf's new tab page without breaking it's configuration, using librewolf.overrides.cfg (together with autoconfig.js)

I'm running Librewolf 134 at the time of this post, this may or may not work for future versions.

This method works without extensions, with focusing the address bar and not displaying the file name, and with Temporary Containers.

I'm doing this on Linux, and I don't know how to do in Windows, but if you look at the Jangsoodlor guide or searching the internet you can piece it together.


As usual, look at about:support for the application binary directory. Mine is /usr/lib/librewolf. Go into it.

Go to defaults/pref, and create a file named autoconfig.js.

Now here's the catch, instead of writing firefox.cfg in the general.config.filename pref, we're gonna put librewolf.cfg which is the prefs config file librewolf uses. Copy and paste this code:


pref("general.config.filename", "librewolf.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);
			

Now we're all done here.

Now go into /home/your_user/.librewolf, and create or open librewolf.overrides.cfg.

Paste the usual javascript into the file, and change the file to your choosing:


//
var {classes:Cc,interfaces:Ci,utils:Cu} = Components;

/* set new tab page */
try {
  Cu.import("resource:///modules/AboutNewTab.jsm");
  var newTabURL = "file:///your/directory/index.html";
  AboutNewTab.newTabURL = newTabURL;
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
			

Restart Librewolf. It should work, and we're all done! Remember this is only for the new tabs, new windows you can change in the Preferences.