简体   繁体   English

是否可以使用代码动态创建隐身/私有模式?

[英]Is it possible to create incognito/private mode dynamically with code?

This is not a question about how to turn on incognito/private mode on a browser, but rather what kinds of things are turned on or off by browsers when that mode is entered, and whether those things can be done dynamically with (presumably) client-side code on the site itself. 这不是关于如何在浏览器上打开隐身/私有模式的问题,而是关于在进入该模式时浏览器打开或关闭了哪些类型的功能,以及这些功能是否可以通过(大概)客户端动态完成网站本身的代码。

I ask because, reason unknown, my site runs faster in incognito/private mode than otherwise. 我之所以这样问是因为,原因未知,我的网站在隐身/私有模式下的运行速度要比其他方式快。 The difference in speed is greatest in IE, which runs at a snail's pace normally, but is faster than all other browsers when my site is executed in its InPrivate viewing mode. IE中的速度差异最大,它通常以蜗牛的速度运行,但是当我的网站以InPrivate查看模式执行时,它比所有其他浏览器都快。

My site involves complex database queries for text and image retrieval from the server, things I wouldn't ordinarily think would be sped up by incognito mode; 我的网站涉及复杂的数据库查询,用于从服务器检索文本和图像,而我通常认为不会通过隐身模式加速。 thus, I'm looking for (1) listings of the various things that browsers do when opened in that mode, and (2) what can be done code-wise (if at all) to effect those conditions when my site executes on a client's browser. 因此,我正在寻找(1)在该模式下打开浏览器时所执行的各种操作的清单,以及(2)当我的网站在某个网站上执行时,可以通过代码方式(如果有的话)执行哪些操作以实现这些条件客户的浏览器。

"Is it possible to create incognito/private mode dynamically with code?" “是否可以使用代码动态创建隐身/私有模式?”

No it's not. 不,这不对。

You can't prevent the browser from storing your navigation / download history, cache, and whatever else isn't stored in incognito mode. 您无法阻止浏览器存储您的导航/下载历史记录,缓存以及其他任何以隐身模式存储的内容。

JavaScript simply doesn't have that kind of access. JavaScript根本没有这种访问权限。

Instead of working around the problem by "forcing" incognito mode like this, it may be more productive, in the long run, to determine what's causing the site to run so slowly. 从长远来看,确定导致网站运行如此缓慢的原因可能不是更有效,而不是通过这样的“强制”隐身模式来解决问题。

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

相关问题 适用于iOS 12 Safari的私密/隐身模式检测 - Private / Incognito Mode Detection for iOS 12 Safari 隐私浏览模式(隐身)下的 Web 存储(sessionStorage 和 localStorage) - Web Storage (sessionStorage and localStorage) in private browsing mode (incognito) 用于跨浏览器检测隐身模式的Javascript(私人浏览) - Javascript For Cross Browser Detection of Incognito Mode (Private Browsing) 是否可以在当前标签页中模拟隐身模式? (chrome扩展名) - Is it possible to simulate incognito mode in current tab? (chrome extension) 我可以在浏览器选项卡的隐身模式下运行 html 代码吗? [等候接听] - Can i run the html code on incognito mode of browser tab? [on hold] chrome隐身模式下的LocalStorage - LocalStorage in chrome Incognito Mode 隐身/私人浏览会中断链接 - Incognito/private browsing breaks links 即使从隐身模式中单击,是否有可能始终在“正常浏览模式”下打开新标签的链接? - Is it possible to have a link that always opens a new tab in 'normal browsing mode', even if clicked from incognito? 社交登录不适用于隐身模式 - Social login is not working with incognito mode JavaScript HTTP 请求不在隐身模式下 - JavaScript HTTP Request Not in Incognito Mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM