Firefox 40:分析JavaScript性能及其他

tech2023-05-07  110

Firefox 40 comes with some powerful new tools and interesting shifts in strategy. Read on for the biggest changes in Firefox and what they mean for you.

Firefox 40附带了一些功能强大的新工具以及有趣的策略转变。 继续阅读以了解Firefox中最大的变化及其对您的意义。

新性能工具 (New Performance Tools)

Firefox 40 features new profiling tools that give developers a better understanding of what's happening from a performance standpoint within their applications. Developers can use these tools to profile performance in any kind of website, app, or game.

Firefox 40具有新的性能分析工具,可以使开发人员从应用程序的性能角度更好地了解正在发生的事情。 开发人员可以使用这些工具来分析任何类型的网站,应用程序或游戏的性能。

The Performance tab contains the new timeline, including three views:

“效果”选项卡包含新的时间表,包括三个视图:

a Waterfall view, giving insights into how your app is performing in the browser:

瀑布视图 ,可深入了解您的应用在浏览器中的性能:

Call Tree view, highlighting any JavaScript performance bottlenecks:

调用树视图 ,突出显示任何JavaScript性能瓶颈:

Flame Chart view, showing the state of the JavaScript stack at every millisecond during the performance profile:

Flame Chart视图 ,显示性能配置文件中每毫秒JavaScript堆栈状态:

Mozilla Hacks has produced a video introduction to the new performance tools:

Mozilla Hacks制作了有关新性能工具的视频介绍:

There's also a demo of how to optimize the JavaScript in an HTML5 game using the new performance tools.

还有一个演示如何使用新的性能工具优化HTML5游戏中JavaScript 。

Head over to the Mozilla Hacks article for more details on the new performance tools.

请访问Mozilla Hacks文章,以获取有关新性能工具的更多详细信息。

关于Windows 10的全部 (All About Windows 10)

Mozilla has integrated fresh optimizations for Microsoft's new operating system. These changes are mostly visual, but there are also subtle performance enhancements.

Mozilla为Microsoft的新操作系统集成了全新的优化。 这些更改大部分是视觉上的,但也有一些细微的性能增强。

Mozilla says it has made

Mozilla 说它已经做了

thoughtful tweaks to the interface to give Firefox a streamlined feel … [with] bigger, bolder design elements as well as more space for viewing the Web.

对界面进行了周到的调整,使Firefox更加流畅……具有更大,更大胆的设计元素以及更多的查看Web的空间。

Firefox 39, on Windows 10, looks like this:

Windows 10上的Firefox 39如下所示:

Firefox 40 on Windows 10 is quite different:

Windows 10上的Firefox 40完全不同:

Firefox 40 has also improved stabilization in Windows 10—Mozilla tests suggesting that it went from 1 crash per 2 days on Windows 8.1 to 0 crashes in 16 days on Windows 10.

Firefox 40还改善了Windows 10的稳定性-Mozilla测试表明,它从Windows 8.1的每2天崩溃1变为Windows 10的16天崩溃0。

There has been controversy over Windows 10 making it difficult for users to switch away from Edge as the default browser and from Bing as the default search engine.

Windows 10 引起了争议 ,用户很难从Edge切换为默认浏览器,从Bing切换为默认搜索引擎。

Firefox 40 makes it easier for users to choose their preferred search engine. To take advantage of this, navigate to Settings (Options) > Search to change the search in Firefox as well as Windows. However, note that you can only change your desktop search preferences when Firefox is your default web browser.

Firefox 40使用户可以更轻松地选择自己喜欢的搜索引擎。 要利用此优势,请导航至“设置(选项) > 搜索”以更改Firefox和Windows中的搜索。 但是,请注意,只有当Firefox是默认的Web浏览器时,才能更改桌面搜索首选项。

Mozilla has helped with clear instructions for restoring Firefox as your default browser if you're struggling to do that in Windows 10.

如果您正在Windows 10中努力做到这一点, Mozilla已为将Firefox恢复为默认浏览器提供了清晰的说明 。

扩展的恶意软件保护 (Expanded Malware Protection)

Malware detection features are now extended in Firefox 40. This has been made possible by recent developments in Google's Safe Browsing service—allowing Firefox to identify malware downloads on the platforms it supports and warn users about potentially unwanted software.

恶意软件检测功能现在已在Firefox 40中进行了扩展。Google的安全浏览服务的最新发展已使之成为可能—允许Firefox识别其支持的平台上的恶意软件下载并警告用户有关潜在有害软件的警告。

This was introduced in Firefox 39, which consisted of extending the monitoring of malicious file downloads to the Mac and Linux versions of Firefox.

Firefox 39中引入了此功能,该功能包括将恶意文件下载的监视范围扩展到Mac和Linux版本的Firefox。

When downloading a file of a type that usually contains Windows or Mac executable code (for example, .com, .exe, .msi, .app, .dmg), Firefox asks Google's Safe Browsing service if the file is safe, by sending it some of the download's metadata (file type, name, size, hash, URL, locale). If the file is flagged as harmful by this service, the download manager will block access to the file until the user performs a right-click, and unblocks it manually.

当下载的文件类型通常包含Windows或Mac可执行代码(例如.com,.exe,.msi,.app,.dmg)时,Firefox会通过发送文件来询问Google的安全浏览服务是否安全下载的某些元数据(文件类型,名称,大小,哈希,URL,区域设置)。 如果此服务将该文件标记为有害文件,则下载管理器将阻止对该文件的访问,直到用户执行右键单击并手动取消对其进行阻止为止。

If you'd rather not send data to Google, you can turn off the feature.

如果您不想将数据发送给Google,则可以关闭该功能 。

In addition to this, Firefox 40 now issues a warning if users visit a page known to contain deceptive software that can make undesirable changes to your computer. If the user encounters such a page, the following warning will show up:

除此之外,如果用户访问已知包含可能对您的计算机进行不良更改的欺骗性软件的页面,则Firefox 40现在会发出警告。 如果用户遇到这样的页面,则会显示以下警告:

附加签名 (Add-on Signing)

With Firefox 40, the era of distributed add-ons in a decentralized manner comes to an end. Unfortunately, there's not much room for this to change, as security and privacy seems to be a priority for Mozilla here.

使用Firefox 40,以分散的方式分发分布式附件的时代结束了。 不幸的是,更改的空间不大,因为安全和隐私似乎是Mozilla在这里的首要任务。

Mozilla announced in February that it will introduce add-on signing in Firefox, to provide a safer add-on experience to its users. Jorge Villalobos, the Add-ons Developer Relations Lead at Mozilla, explains:

Mozilla在2月份宣布,它将在Firefox中引入附加签名,以为其用户提供更安全的附加体验 。 Mozilla附加组件开发人员关系负责人Jorge Villalobos解释说:

The Mozilla add-ons platform has traditionally been very open to developers. Not only are extensions capable of changing Firefox in radical and innovative ways, but developers are entirely free to distribute them on their own sites, not necessarily through AMO, Mozilla's add-ons site. This gives developers great power and flexibility, but it also gives bad actors too much freedom to take advantage of our users.

传统上,Mozilla附加组件平台对开发人员非常开放。 扩展程序不仅能够以激进和创新的方式改变Firefox,而且开发人员完全可以自由地将其分发到自己的站点上,而不必通过Mozilla的附加站点AMO进行分发。 这为开发人员提供了强大的功能和灵活性,但同时也为不良行为者提供了太多的自由以利用我们的用户。

In Firefox 40, you'll see a warning if you're using an unsigned add-on. In Firefox 41, however, unsigned add-ons will be disabled, and you won't be able to enable them unless you head over to about:config and disable xpinstall.signatures.required. The plan is for the latter to be disabled in Firefox 42, after which there'll be no way to override that setting. There's been a lot of criticism of this, but it seems Mozilla has already made its decision.

在Firefox 40中,如果您使用的是未签名的加载项,则会看到警告。 但是,在Firefox 41中,未签名的加载项将被禁用,除非您转到about:config并禁用xpinstall.signatures.required否则您将无法启用它们。 计划在Firefox 42中禁用后者,在那之后将无法覆盖该设置。 对此有很多批评,但是Mozilla似乎已经做出了决定。

Mozilla has provided an FAQ with more details on what's involved. Also, if you're an add-on developer, you might want to read the guidelines on the Mozilla Developer Network.

Mozilla提供了一个FAQ ,其中包含涉及的更多详细信息。 另外,如果您是附加开发人员,则可能需要阅读Mozilla开发人员网络上的指南 。

Firefox 40中的其他显着变化 (Other Notable Changes in Firefox 40)

Firefox Hello now allows adding a link to conversations to provide context on what the conversation will be about (basically specifying a topic).

Firefox Hello现在允许添加到会话的链接,以提供有关会话内容的上下文(基本指定主题)。 The scrolling, graphics, and video playback performance is vastly improved, with off main thread compositing in GNU/Linux.

滚动,图形和视频播放性能得到了极大的提高,并且在GNU / Linux中使用了非主线程合成功能。 Animations and scrolling are now smoother in Windows, thanks to VSync.

现在,借助VSync,Windows中的动画和滚动现在更加流畅。

A new page ruler highlighting tool that displays lightweight horizontal and vertical rules on a page is now available.

现在提供了一个新的页面标尺突出显示工具,该​​工具可以在页面上显示轻量级的水平和垂直规则 。

The Inspector allows searches across all content frames in a page.

检查器允许在页面中的所有内容框架中进行搜索。

For a more complete list of changes, check out the Firefox 40 release notes.

有关更改的更完整列表,请查看Firefox 40发行说明 。

结语 (Wrap Up)

You can update your Firefox installation either by patiently waiting for the auto-update, choosing About Firefox within the browser's menu, or downloading the new installer manually from Firefox.com.

您可以耐心等待自动更新,在浏览器菜单中选择“ 关于Firefox ”,或者从Firefox.com手动下载新的安装程序,从而更新Firefox安装。

What do you think of Firefox 40? How do you feel about the add-on signing issue? Are the new features enhancing your experience? Especially if you're using Windows 10, let us know your thoughts in the comments!

您如何看待Firefox 40? 您对附加签名问题有何看法? 这些新功能是否在增强您的体验? 特别是如果您使用的是Windows 10,请在评论中让我们知道您的想法!

翻译自: https://www.sitepoint.com/firefox-40-profiling-javascript-performance-and-more/

相关资源:profiler:Firefox Profiler —用于Firefox性能分析的Web应用程序-源码
最新回复(0)