Skip to main content
Topic: Resolved: Librewolf and newtab page (Read 1580 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Resolved: Librewolf and newtab page

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, but like the person in that thread, nothing helped me.

Re: Librewolf and newtab page

Reply #1
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...

Re: Librewolf and newtab page

Reply #2
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.

Re: Librewolf and newtab page

Reply #3
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

Re: Resolved: Librewolf and newtab page

Reply #4
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.

Re: Resolved: Librewolf and newtab page

Reply #5
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!