I want to open new tabs in a local page
I want my new tabs in Firefox Quantum to open to my home page. My home page is a local page with all of my frequently used links on it. I've tried using New Tab Homepage and New Tab Override, and neither of them gives me what I want. I can easily do this with EVERY OTHER BROWSER I use; why not Firefox?
Gekozen oplossing
I'm afraid that the cut-and-paste from your other post was missing a line of code. The complete code looks like this:
// mozilla.cfg needs to start with a comment line var {classes:Cc,interfaces:Ci,utils:Cu} = Components; /* set new tab page */ try {
var newTabURL = "file:///C:/Users/<path_to_file>"; aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService); aboutNewTabService.newTabURL = newTabURL;
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
This works, thank you very much.
Thanks also to my friend OrangeRider who found the error and fixed this.
Alle antwoorden (9)
If you can't do this with an extension then you can use a mozilla.cfg file in the Firefox program folder.
See Configuration:
- https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment Enterprise_deployment_before_60
See also:
You can use the mozilla.cfg file in the Firefox program folder to initialize (set/lock) preferences and run privileged JavaScript code.
The mozilla.cfg file needs to be in the main Firefox program folder
This requires a local-settings.js file in the "defaults/pref" folder where the channel-prefs.js file is located that specifies to use mozilla.cfg.
// pref("general.config.filename", "mozilla.cfg"); pref("general.config.obscure_value", 0);
The mozilla.cfg and local-settings.js files need to start with a comment line (//).
You can open the local file in a tab to get the correct URL to use in the newTabURL variable.
// mozilla.cfg needs to start with a comment line /* set new tab page */ try { var newTabURL = "file://"; aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService); aboutNewTabService.newTabURL = newTabURL; } catch(e){Cu.reportError(e);} // report errors in the Browser Console
Thank you for the quick reply. I'm afraid that these articles are way out of my depth; I can barely spell javaScript. I'm going to see if one of my friends can help me with this and I'll post here once I have results.
Gekozen oplossing
I'm afraid that the cut-and-paste from your other post was missing a line of code. The complete code looks like this:
// mozilla.cfg needs to start with a comment line var {classes:Cc,interfaces:Ci,utils:Cu} = Components; /* set new tab page */ try {
var newTabURL = "file:///C:/Users/<path_to_file>"; aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService); aboutNewTabService.newTabURL = newTabURL;
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
This works, thank you very much.
Thanks also to my friend OrangeRider who found the error and fixed this.
Sorry. I forgot to add the var {classes:Cc,interfaces:Ci,utils:Cu} = Components; line that is at the start of my mozilla.cfg file when I copied the new tab section further down.
This sets the new-tab page for all users on the whole machine. What about the case when it's multi-user? ...and what about permissions in a multi-user environment -- do you expect all users to be able to fiddle with /usr/lib64?
In particular, when I do "ls -1 /nas/longleaf/home/ | wc -l" I get 1315 users...
Code in mozilla.cfg in the Firefox installation folder works for all users that start this specific Firefox version.
See also:
cor-el said
Code in mozilla.cfg in the Firefox installation folder works for all users that start this specific Firefox version. See also:
Does not help the issue: ordinary users on a Linux server do not have the access permissions necessary to do that for their own firefox session. And if they did, why should one user be allowed to clobber another?
A user who would want to modify settings via mozilla.cfg would have to install Firefox in a folder in their home directory to have write permission and make the change only for their Firefox installation.
I cant find mozilla.cfg and i need the new tab to open my local file, i am the only user no security risk at all, why dont you allow override or put a password on this so noone but me can change that setting if thats all that worries you? i cant stand blank pages or cheasy pages made by browsers i like my own the new browser is also not working right with iframes on local pages either its now trying ips that dont exist on my network why cant you stop taking out features i use and then claim its better than before!!! i need the last version that worked with new tabs for local files or put this feature in!!! help me i cant remember which version i had why cant you have a downgrade button and also say on the browser options the previous installed version?