Artix Linux Forum

General Category => Off-Topic => Topic started by: Worm_Jim on 21 August 2025, 05:35:47

Title: Resolved: Librewolf and newtab page
Post by: Worm_Jim on 21 August 2025, 05:35:47
Hi. Has anyone managed to configure librewolf so that when a new tab is opened, a local html file is opened? I found this thread (https://codeberg.org/librewolf/issues/issues/2313), but like the person in that thread, nothing helped me.
Title: Re: Librewolf and newtab page
Post by: kixik on 21 August 2025, 06:24:23
But that issue was closed as solved, indicating:

> Issue has been SOLVED!!
>
> The new method for setting a custom new tab page on Firefox 136.0 and above is as below:
>
> https://gitlab.com/fazzi/nixohess/-/blob/main/home/modules/apps/browsers/librewolf/default.nix?ref_type=heads#L49
>
> tldr: ...

Perhaps it changed again?  That's more of a FF thing than a Librewolf one BTW, and lately there have been several changes going on it seems...
Title: Re: Librewolf and newtab page
Post by: Worm_Jim on 21 August 2025, 08:33:10
Librewolf is based on Firefox, so it doesn't matter, but if anything FF it doesn't work either. I tried the old method (in the first post) and it didn't work. Yes, I used the versions of the packages specified there. I don't know the nix language to understand what needs to be added to librewolf.overrides.cfg and all my attempts fail.
Title: Re: Librewolf and newtab page
Post by: Worm_Jim on 22 August 2025, 07:21:16
Create a file /usr/lib/librewolf/defaults/pref/autoconfig.js with the following content:
Code: [Select]
pref("general.config.filename", "librewolf.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);
Add to the top of /usr/lib/librewolf/librewolf.cfg, this:
Code: [Select]

null;

const base_page = "file:///home/New_tab/index.html";

//
try {
  const ctx = {};
  ChromeUtils.defineESModuleGetters(ctx, {
    AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs"
  });
  ctx.AboutNewTab.newTabURL = base_page;
} catch (e) {
  ChromeUtils.reportError(e);
}

lockPref("browser.startup.homepage", base_page);
lockPref("browser.startup.page", 3);
lockPref("browser.startup.homepage_override.mstone", "ignore");
lockPref("browser.newtabpage.activity-stream.aboutHome.enabled", false);

/** ------------------------------
* My settings. Changes base page.
* ------------------------------- */

Replace file:///home/New_tab/index.html with the path to your file. Check the files permissions (should be 644):
Code: [Select]
stat --format='%a %n' /usr/lib/librewolf/defaults/pref/autoconfig.js
stat --format='%a %n' /usr/lib/librewolf/librewolf.cfg
Restart LibreWolf and enjoy!

Source: https://github.com/AnDsergey13/New_tab
Title: Re: Resolved: Librewolf and newtab page
Post by: Shoun2137 on 22 August 2025, 09:14:32
https://github.com/n6v26r/.dotfiles/blob/main/firefox.md I think I posted this before this thread was nuked by the forum maintenance. I also mentioned that it's easier to make a dummy browser addon that replaces this functionality, it doesn't have to be signed by mozilla and you don't have to modify your local browser installation.

Also please, if you can, make the file here with something like pref("general.config.filename", "aooe2moaaaaa209eia2.d20dk0123"); + the script - and then lock this as immutable (chattr +i), because any other external program on your pc could modify this on their own. It's just a matter of hardening this. Not worth leaving this as open gate to your data.
Title: Re: Resolved: Librewolf and newtab page
Post by: Worm_Jim on 22 August 2025, 09:38:26
Unfortunately the previous thread was lost and I didn't get any feedback on the question asked, but I'm glad there was a working solution. Thanks for your reply!