火狐浏览器与chrome_在Google Chrome和Mozilla Firefox中查看浏览器重画

火狐浏览器与chrome

One goal of super-optimized websites is to prevent browser repaints due to changes in a block's style or content. There are numerous ways we intentionally (or unintentionally) trigger block repaints, but the browser does it so quickly we have trouble seeing when and where it happens. Recognizing the importance of allowing developers to micro-optimize their pages, the Chrome and Firefox teams have added features to their browsers to allow us to see those repaints. Here's how to do it!

超级优化的网站的一个目标是防止由于块的样式或内容的更改而导致浏览器重新绘制。 我们有多种方式有意(或无意地)触发了块重绘,但是浏览器是如此之快,以至于我们很难看到它何时何地发生。 Chrome和Firefox团队认识到允许开发人员对页面进行微优化的重要性,因此已在其浏览器中添加了一些功能,使我们可以查看这些重绘。 这是怎么做!

谷歌浏览器和金丝雀 (Google Chrome & Canary)

The repaint feature needs to be enabled at startup for Chrome and Canary with the --show-paint-rects config:

需要在启动时--show-paint-rects配置为Chrome和Canary启用重新绘制功能:


open ./Google\ Chrome\ Canary.app --args --show-paint-rects


Be sure to include --args in your command or you'll run into problems opening the browser. Repaints will display on each site you visit.

确保在命令中包含--args--args在打开浏览器时会遇到问题。 重新粉刷将显示在您访问的每个站点上。

Mozilla Firefox,Aurora,每晚 (Mozilla Firefox, Aurora, Nightly)

To view repaints in Firefox and Aurora browsers, you need to enable an about:config option. The option name is nglayout.debug.paint_flashing. Turn this option to true and you'll quickly see repaints as the happen!

要在Firefox和Aurora浏览器中查看重绘,您需要启用about:config选项。 选项名称为nglayout.debug.paint_flashing 。 将此选项设置为true,您很快就会看到重新绘制!

At the time of publish, only nightly exposed this config feature.

在发布时,仅每晚公开此配置功能。

I recommend you take a few moments to scope out the repaint frequency on your websites and see what you can do to improve performance!

我建议您花一些时间来确定网站上的重绘频率,然后看看可以采取哪些措施来提高性能!

翻译自: https://davidwalsh.name/browser-repaint

火狐浏览器与chrome

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值