本文介绍了要实现对Javascript的多屏支持,需要做些什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想知道对javascript的多显示器/屏幕支持时,我发现了与该主题相关的以下stackexchange问​​题:

As I was wondering about the multi-monitor/screen support of javascript i found the follwing stackexchange questions relevant for the topic:

  • 2013 - 40k views: window.open() on a multi-monitor/dual-monitor system - where does window pop up?
  • 2014 - 10 k views: window.open on second monitor
  • 2016 - 42 views: How to show a webpage onto another monitor connected to it on click of a button?
  • 2008 - 11 k views: Testing for multiple screens with javascript
  • 2017 - ~1k views: https://webmasters.stackexchange.com/questions/103269/auto-open-fullscreen-on-another-monitor

很多问题和答案都围绕缺少使用javascript处理多个屏幕的选项.出于安全性和技术原因而命名,以解释这种功能的不存在.

Quite a few of the questions and answers revolve around the missing option of handling multiple screens with javascript. Security and technical reasons are named to account for the non-existence of such a feature.

另一方面,数千个观点表明对该主题感兴趣,并且人们已经尝试了很多年的变通方法.

On the other hand a few thousand views show that there is interest in the topic and people have tried work-arounds for many years.

因此,我第二次 我想使该过程自动化,以便他们在加载第一个地址后立即在第二个监视器上自动弹出第二个窗口并全屏显示. .这是仅供内部使用的行为. 来自Webmasters.stackexchange问​​题,我想知道需要做些什么才能获得此功能?

例如是否必须更改HTML标准,例如 2014年以来对代码项目的疑问 -浏览器供应商需要做些什么吗?是否需要添加Javascript,例如我们可以从客户端访问哪些信息?是启动解决方案并开始运行的措施?

E.g. would the HTML standard have to be changed see e.g. question from 2014 on code project - would the browser vendors have to do something? Would there be a need for a Javascript addition to e.g. What information can we access from the client? And what would be the actions to get a solution up and running?

顺便说一句-如果您认为这是题外话,那么我将不得不更改我的问题,以使它不会被关闭.我对此非常认真-我已经看过很多次了.

And by the way - if you think this is off-topic how would I have to change my question so that it won't be closed. I am very serious about this - there is a need behind this that I have seen quite a few times already.

推荐答案

从Chrome版本66开始,可以使用演示文稿API 自2019-04年以来,有一个 W3C草案

Since Version 66 of Chrome it is possible to use the Presentation APIThere is a W3C Draft for it since 2019-04

示例

将在Chrome 66+中运行并给出错误消息

will work in Chrome 66+ and given an error message

ReferenceError: PresentationRequest is not defined (Your browser may not support this feature.)

对于其他浏览器,当单击presentationRequest.start()时.在Chrome 66+上,会出现一个选择对话框

for other browsers when clicking presentationRequest.start().On Chrome 66+ a selection dialog appears

并在选择所需的屏幕后以全屏模式使用.

and after picking the desired screen is used in full screen mode.

这篇关于要实现对Javascript的多屏支持,需要做些什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:32