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

搜索 | 用户支持

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

详细了解

open link in the same tab

more options

On some tabs, when I click on a link, a new tab opens with that linked web page. I want to open the link in the same tab. Is there a way to do this?

On some tabs, when I click on a link, a new tab opens with that linked web page. I want to open the link in the same tab. Is there a way to do this?

所有回复 (1)

more options

Firefox takes its cue from how the site has coded its links. Usually they stay in the same tab, but they will open in a new window or tab if:

  • the site specifies a "target" in the link
  • the site attaches a script to the link that opens a new window

There is a group of setting that should force Firefox to ignore these aspects of the link, but I never tried it myself. If you want to experiment:

(1) 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.

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

(3) Adjust the preferences as follows:

(A) browser.link.open_newwindow - for links in Firefox tabs

  • 3 = divert new window to a new tab (default)
  • 2 = allow link to open a new window
  • 1 = force new window into same tab <= Try this one

(B) browser.link.open_newwindow.restriction - for links in Firefox tabs

  • 0 = apply the setting under (A) to ALL new windows (even script windows) <= Try this one
  • 2 = apply the setting under (A) to normal windows, but NOT to script windows with features (default)
  • 1 = override the setting under (A) and always use new windows

(C) browser.link.open_newwindow.override.external - for links in other programs

  • -1 = apply the setting under (A) to external links (default)
  • 3 = open external links in a new tab in the last active window <= Try this one
  • 2 = open external links in a new window
  • 1 = open external links in the last active tab replacing the current page

To return to normal if things go haywire, right-click each "modified" preference and choose Reset.

If you need a test page: https://jeffersonscher.com/res/popit.html