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

搜索 | 用户支持

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

详细了解

Auto Scrolling page to same position after refreshing?

  • 1 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 user2258076

more options

Hello! When I working with developing web pages I testing some element in the middle or bottom of page. Then, when I edited some css files I need refresh page - to see changes in frontend. When I do it in Chrome - it scrolling page to same position automatically. But in Firefox I need to scroll page manually each time I refresh page. Is it possible to fix it?

Hello! When I working with developing web pages I testing some element in the middle or bottom of page. Then, when I edited some css files I need refresh page - to see changes in frontend. When I do it in Chrome - it scrolling page to same position automatically. But in Firefox I need to scroll page manually each time I refresh page. Is it possible to fix it?

所有回复 (1)

more options

Hello, this brigade engineering article might help you out.

From what I've gathered, in traditional websites, scroll restoration works fine in most browsers (including Firefox). But for single page applications, page loads can happen even before all site content is available so scroll restoration is typically not available (except in Chrome).

To enable it, I'd guess that you have to work from your application's code, the method to do that could depend on the framework you are using to build your application.

I'm not knowledgeable in single page app development but maybe you could try setting the History.scrollRestoration to 'auto' in the History API.