简体   繁体   English

Chrome自动标签页放弃禁用Java脚本?

[英]Chrome auto tab discarding disable java script?

Chrome implement new feature which is called auto tab discarding through this feature enable user when user not on the tab that tab will discard and when user re click on that tab chrome auto refresh that tab. Chrome浏览器实现了一项称为“自动标签页丢弃”的新功能,通过此功能,当用户不在该标签页上时,该标签页将被丢弃;当用户重新点击该标签页时,Chrome浏览器会自动刷新该标签页。 here is the link of Article . 这里的链接文章 this is is very good feature But my problem is I'm showing notification when our tab is active in chrome but because of this feature our Tab is discard and not able to show notifications anymore. 这是一个非常好的功能,但是我的问题是,当我们的标签页在chrome中处于活动状态时,我正在显示通知,但是由于此功能,我们的标签页已被丢弃,无法再显示通知。

My Question is :- How to Disable this feature or there is any way to keep my tab active or any way to prevent that from discarding? 我的问题是 :-如何禁用此功能,或者有什么方法可以使我的标签处于活动状态,或者有什么方法可以防止该标签被丢弃?

Users can switch off automatic tab discarding by setting the respective flag in Chrome using this link: chrome://flags/#automatic-tab-discarding 用户可以通过以下链接在Chrome中设置相应的标志来关闭自动标签丢弃:chrome:// flags /#automatic-tab-discarding

But every page with states depending on user input do have the same problem like yours. 但是每个状态取决于用户输入的页面都会遇到与您相同的问题。 Usually, you can prevent unloading a page with handling the onbeforeunload event in JavaScript. 通常,您可以通过处理JavaScript中的onbeforeunload事件来防止卸载页面。 Unfortunately, Google does not prevent a solution for this on all systems, despite many users had problems with this feature already in the experimental phase, as you can read in the user comments: https://developers.google.com/web/updates/2015/09/tab-discarding 不幸的是,尽管许多用户在实验阶段就已经对此功能存在问题,但Google并未阻止在所有系统上都找到解决方案,您可以在以下用户评论中阅读: https : //developers.google.com/web/updates / 2015/09 /制表丢弃

For ChomeOS, the problem seams to be fixed: https://bugs.chromium.org/p/chromium/issues/detail?id=123049 对于ChomeOS,问题已解决: https ://bugs.chromium.org/p/chromium/issues/detail?id=123049

On Android, automatic tab discarding is quite aggressive and prevents using Chrome for applications with significant user input, imho. 在Android上,标签页自动放弃功能非常激进,会阻止将Chrome用于需要大量用户输入的应用程序,恕我直言。

On Windows, automatic tab discarding only starts if the available memory is low. 在Windows上,仅在可用内存不足时才开始自动选项卡丢弃。

Sorry for not coming up with a proper solution here (I'd be really happy to have one) - I did extensive research and this is all I could find. 很抱歉在这里没有找到合适的解决方案(我很高兴有一个解决方案)-我进行了广泛的研究,这就是我所能找到的全部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM