|
尝试挂起:
在控件最小化或不可视时,应用程序可以调用"尝试挂起"以使浏览器消耗更少的内存.
挂起将暂停视图脚本计时器和动画,最大限度地减少浏览器渲染器进程的CPU使用.
原接口 TrySuspend 之所以封装命名为 “尝试挂起” 是因为不保证一定能将网页休眠,因为有很多种情况会阻止休眠状态
以下活动可能阻止网站进入睡眠状态:
The page is currently visible (active tab)
页面当前可见(活动选项卡)
The page is currently holding a Web Lock or an IndexedDB transaction
该页面当前持有 Web Lock 或 IndexedDB 事务
The page is sharing its BrowsingInstance with another page
该页面正在与另一个页面共享其 BrowsingInstance
The page is your company’s internal (intranet) site
该页面是内部 (Intranet) 站点
The page is currently being inspected by DevTools
DevTools 当前正在检查该页面
The page is currently playing audio
该页面当前正在播放音频
The page is currently capturing a window or screen
页面当前正在捕获窗口或屏幕
The page is currently capturing user media (webcam, microphone, etc)
该页面当前正在捕获用户媒体(网络摄像头、麦克风等)
The page is currently being mirrored (casting, etc)
页面当前正在镜像(投射等)
The page is on the user’s block list in Settings
该页面位于“设置”中的用户阻止列表中
The page is currently using WebUSB
该页面当前正在使用 WebUSB等.........
参考资料
睡眠标签页常见问题解答 - Microsoft Community Hub --- Sleeping tabs FAQ - Microsoft Community Hub
|
|