为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Under "New Windows and Tabs", you can set your Homepage. How can I get New Tabs to use the Homepage I have selected?

  • 3 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

Go to "about:preferences". Select "Home". Under "New Windows and Tabs", see options "Homepage and new windows". Choose "Custom URLs...". Enter a local HTML file in the address box.

Now, when you open a new Firefox window, the local HTML file will open as your homepage. This is good.

However, if you open a new tab, your selected homepage will NOT load. Go back to the "New Windows and Tabs" preferences section. Under "New Windows and Tabs", see options "New tabs". The only options here are "Firefox Home" and "Blank Page". I expect to see either the same options as for my homepage above, or an option to use the chosen homepage from above.

I have been using the extension "New Tab Override", but this is an insufficient solution because it cannot support local files in a usual way (due to limitations in the Firefox API). It has a workaround which allows it to load up and store a local file for its use, but this is insufficient because the file is copied and stored by the extension - changes to the file are not reflected until you go into the extension settings and purge and reload it.

Go to "about:preferences". Select "Home". Under "New Windows and Tabs", see options "Homepage and new windows". Choose "Custom URLs...". Enter a local HTML file in the address box. Now, when you open a new Firefox window, the local HTML file will open as your homepage. This is good. However, if you open a new tab, your selected homepage will NOT load. Go back to the "New Windows and Tabs" preferences section. Under "New Windows and Tabs", see options "New tabs". The only options here are "Firefox Home" and "Blank Page". I expect to see either the same options as for my homepage above, or an option to use the chosen homepage from above. I have been using the extension "New Tab Override", but this is an insufficient solution because it cannot support local files in a usual way (due to limitations in the Firefox API). It has a workaround which allows it to load up and store a local file for its use, but this is insufficient because the file is copied and stored by the extension - changes to the file are not reflected until you go into the extension settings and purge and reload it.

所有回复 (3)

more options

Hi worlebird, there's no convenient way to use a file:// URL for your new tab page, as you've discovered.

As noted in the other thread where you posted, here in support we work with the Firefox we have today and can suggest relevant features, available settings changes, and workarounds such as add-ons. If those do not suit your needs, you can submit comments and suggestions through one or more of the following links:


In Firefox 58 and earlier, there was a method to use a configuration file to modify the new tab page at startup. However, that was supposed to stop working in Firefox 59, so the method in this thread may be obsolete: I want to open new tabs in a local page.

If you wanted to run the script by hand in the Browser Console:

(1) One-time setup

(A) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(B) In the search box above the list, type or paste devt and pause while the list is filtered

(C) Double-click the devtools.chrome.enabled preference to switch the value from false to true

Be cautious about the scripts you run!

(2) Script to override the new tab page for the current session

You can open the separate Browser Console window using either:

  • "3-bar" menu button > Web Developer > Browser Console
  • (menu bar) Tools > Web Developer > Browser Console
  • (Windows) Ctrl+Shift+j

Paste the following script after the caret (»), edit about:newtab to the desired URL, and press Enter to execute it:

var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
try {
  aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService);
  aboutNewTabService.newTabURL = 'about:newtab';
} catch(err){
  Cu.reportError(err);
}

More info on the Browser Console: https://developer.mozilla.org/docs/Tools/Browser_Console

more options

worlebird said

  • Go to "about:preferences".
  • Select "Home".
  • Under "New Windows and Tabs", see options "Homepage and new windows".
  • Choose "Custom URLs...".
  • Enter a local HTML file in the address box.


Now, when you open a new Firefox window, the local HTML file will open as your homepage. This is good.

However, if you open a new tab, your selected homepage will NOT load...


See This Post.


~Pj

more options

Note that probably using only this line will work in the Browser Console:

  • aboutNewTabService.newTabURL = "about:newtab";
  • "3-bar" menu button or Tools -> Web Developer

This is a getter/setter, so you can check the curren newTabURL setting via:

  • aboutNewTabService.newTabURL;