Closed Bug 1179101 Opened 9 years ago Closed 5 years ago

NewTabURL object doesn't work in mozilla.cfg configuration file

Categories

(Firefox :: New Tab Page, defect)

42 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dvlcornelis, Unassigned)

References

Details

Currently the browser.newtab.url pref is no longer supported (Bug 1118285).

I was using this pref to set the new tab page to about:blank
The NewTabURL object as defined in NewTabURL.jsm that has been created to make it easier to modify the new tab page doesn't work when called in the mozilla.cfg configuration file.
So it isn't possible to use NewTabURL.override() to at least set a new tab page.
http://mxr.mozilla.org/mozilla-central/source/browser/modules/NewTabURL.jsm

This throws an error and the catch block is evaluated:
var newTabURL = "about:blank";
try {
NewTabURL.override(newTabURL);
pref("browser.newtab.url",NewTabURL.get());
}
catch(e) {
pref("browser.newtab.error","<error>");
}

This code works for me (the catch block is to facilitate older Firefox versions), but I don't know if it is a good idea or acceptable to load this module in mozilla.cfg.

var newTabURL = "about:blank";
try {
Components.utils.import("resource:///modules/NewTabURL.jsm");
NewTabURL.override(newTabURL);
pref("browser.newtab.url",NewTabURL.get());
}
catch(e) {
pref("browser.newtab.url",newTabURL);
}

Anyway I don't think that it should require this extra effort to set a new tab page via mozilla.cfg and it won't be possible to lock the new tab setting.
Maybe this pref should be re-added and only have effect in locked state via a set/read sequence that fails if locked possibly similar to xpinstall.enabled that only works when locked to false.

Hello!

This bug has been closed due to inactivity and/or the potential for this bug to no longer be an issue with the new Discovery Stream-powered New Tab experience.

Please help us triage by reopening if this issue still persists and should be addressed.

Thanks!

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.