获取监视器计数 [英] Get Monitor Count

查看:93
本文介绍了获取监视器计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,我想实现以下行为。

I have a web application that I'd like to implement the following behavior.

当您点击特定链接时:


  • 如果用户有多个监视器 - 在具有给定名称的窗口中打开URL。

  • If the user has more than one monitor - open the url in a window with a given name.

否则 - 将iframe的src属性更改为url属性。

Otherwise - change the iframe's src attribute to that of the url.

如何做我在JavaScript中检测到了显示器数量?

如果不可能,那么仅限Chrome的解决方案也适用于Intranet应用程序。

If it's impossible, a Chrome only solution would also work since this is for an intranet app.

推荐答案

正如其他人所说,唯一明智的做法是询问用户。之前提出并拒绝了允许这种做法的提案。多显示器设置在一般人群中并不常见,这就是为什么会被忽略的原因。

As others have said the only sensible way to do this is to ask the user. A proposal to allow this has been raised and declined before. Multi monitor setups are not very common in the general population which is why this is ignored.

替代方案是:


  • 提示用户。

  • 要求用户运行浏览器扩展程序(不那么有趣,风险更大)。

  • 通过插件运行(也不是很有趣)。

  • 通过类似WebkitJS的方式提供您的应用程序

  • Prompt the user.
  • Ask the user to run a browser extension (less fun and more risky).
  • Run through a plugin (also not very fun).
  • Serve your app through something like WebkitJS

总体而言 - 对于普通网站,唯一的选择是提示用户。

Overall - for normal websites the only option is to prompt the user.

这篇关于获取监视器计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆