Set custom HTML file as a new tab in Firefox
You might want to set up your custom HTML page which contains all the links which you want to access frequently or might want to use StartTree and something like that.
We will be using AutoConfig, which is used to set and lock preferences that are not covered by group policy, This requires an autoconfig.js file in the “defaults/pref” folder where the channel-prefs.js file is located that specifies to use autoconfig.cfg.
Steps:⌗
-
Go the settings → Home → Set HomePage and new window => cutom_urls → Enter the file path.
-
Set new tab to
Firefox Home
. -
Make sure no other extension is managing your new tab, Go to Settings → Extension.
-
Create autoconfig.cfg file
sudo vim /usr/lib/firefox/autoconfig.cfg
<h1>Hello</hello>
Paste this:
/* first line must be comment */ var {classes:Cc,interfaces:Ci,utils:Cu} = Components; /* set new tab page */ try { Cu.import("resource:///modules/AboutNewTab.jsm"); var newTabURL = "file:///home/stroky/.cache/StartTree/index.html"; AboutNewTab.newTabURL = newTabURL; } catch(e){Cu.reportError(e);} // report errors in the Browser Console
-
Then create autoconfig.js
sudo vim /usr/lib/firefox/defaults/pref/autoconfig.js
Paste this:
// *First line must be a comment* pref("general.config.filename", "autoconfig.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false);
-
Quit the Firefox, and relaunch it.
- And we are done.
Reference: Mozilla support | AutoConfig Docs