main About me Back to Posts Personal Projects Links Privacy Contact
I have my own hand-coded HTML file I use as my home page in all of my browsers. It’s light and loads fast and has all of the links I use on a regular basis. I love it and would hate to live without it. Firefox, though, does not love it, out of the box.
For security reasons, I’m sure, the browser doesn’t allow users to set a local file of any sort as the home page for new tabs. We can set it as the default home page, right in Options > Home screen, but that only applies to when Firefox first starts up and to new windows. And there used to be extensions which could provide this missing feature, but they’ve been made useless with recent Firefox updates (v72 near the end of 2019) so that’s no longer an option.
After much searching, I found this Mozilla Firefox Support page describing the how to make this work. Check it out and follow those steps if you too want to use a local file as your new tab home page.
How do I set my local HTML page as a homepage? (support.mozilla.org)
And just in case that page ever goes away, here are the steps spelled out (and for my own future reference):
Updated May 16 2020 for Firefox 76. The new browser version broke the older code. This works well for me now.
// first line is a comment
var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
try {
Cu.import("resource:///modules/AboutNewTab.jsm");
var newTabURL = "file:///C:/Users/yourname/yourfile.html";
AboutNewTab.newTabURL = newTabURL;
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);
And voila! It works (until Mozilla changes something else, at least) Enjoy!
October 18 2022
Danny wrote, “Thank you! Your solution for getting Firefox to open a local file in a new tab worked like a charm. I really appreciate it when people smarter than me share their knowledge.”
You’re welcome but really, I still owe the internet in terms of neat solutions to tough problems. Glad I could help in this case.