搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

what has replaced "window.home" as it is documented as obsolete

  • 7 回覆
  • 1 有這個問題
  • 4 次檢視
  • 最近回覆由 biol75

more options

Hi, on the support page, https://developer.mozilla.org/en-US/docs/Web/API/Window/home it says that

window.home()

is Obsolete since Gecko 31 (Firefox 31 / Thunderbird 31 / SeaMonkey 2.28, but it gives no hint if there is a replacement or equivalent way of going to the user's home page

thanks chris

Hi, on the support page, https://developer.mozilla.org/en-US/docs/Web/API/Window/home it says that window.home() is Obsolete since Gecko 31 (Firefox 31 / Thunderbird 31 / SeaMonkey 2.28, but it gives no hint if there is a replacement or equivalent way of going to the user's home page thanks chris

所有回覆 (7)

more options

Are you talking about about:home ?

more options

FredMcD said

Are you talking about about:home ?

Sorry, this was code to load the users' home page into the current window, and used to work with older firefoxes

more options

I've called the big guys to help you. Good luck.

more options

See:

  • bug 1012944 - User login and account creation on deezer.com broken since Firefox 30.0b1, say home.display is not a function

Please do not comment in bug reports
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

more options

Do you mean a method a website can use, or a method an extension can use? I don't think there is a method a website can use to navigate a tab to the user's home page. However, an extension probably can do that using a method in the SDK.

more options

Actually this does work for me in Firefox 31 if I run this command (window.home()) in the Web Console with this page open and it brings me to my home page (about:about) in the same tab. The Back button brings me to the previous page. I'm not sure why you would ever allow a website to navigate this way if that is possible.

The above linked articles writes:

The non-standard, Netscape-derived window.home, window.back and window.forward methods have been removed. The standard history.back and history.forward methods can be used instead to manipulate the browser history.
more options

Thanks for the comments. I'm sorry to learn that a "netscape" command is non-standard, but appreciate time moves on.