![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
firefox.cfg no longer overwrite new tab content
This code in mozilla.cfg used to overwrite new tab, but as of latest firefox 136.0b1 no longer works. Any way to fix this? There error in Browser Console.
// mozilla.cfg needs to start with a comment line var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
/* set new tab page */ try {
Cu.import("resource:///modules/AboutNewTab.jsm"); var newTabURL = "file:///D:/Documents/images/home.html"; AboutNewTab.newTabURL = newTabURL;
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
被采纳的解决方案
Found the solution:
// mozilla.cfg needs to start with a comment line ChromeUtils.defineESModuleGetters(this, {AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs",});
var newTabURL = "file:///D:/Documents/images/home.html"; AboutNewTab.newTabURL = newTabURL;定位到答案原位置 👍 0
所有回复 (1)
选择的解决方案
Found the solution:
// mozilla.cfg needs to start with a comment line ChromeUtils.defineESModuleGetters(this, {AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs",});
var newTabURL = "file:///D:/Documents/images/home.html"; AboutNewTab.newTabURL = newTabURL;