按 CTRL+TAB 的 JavaScript 代码?
由于无法使用 javascript 移动到下一个选项卡,
是否有代码可以按下 CTRL + Tab 以便移动到下一个选项卡?
Since there's no way of moving to the next tab using javascript,
is there a code which presses CTRL + Tab so it'd move to the next tab?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是不可能。
如果 JavaScript 能够以这种方式控制浏览器,将会带来安全风险。
想象一下,一个恶意网站(或一个愚蠢的开发人员)每秒都试图将焦点设置到包含其网站的选项卡上......
It's not possible.
It would be a security risk for JavaScript to have the ability to control the browser in that way.
Imagine a malicious site (or a stupid developer) attempting to set the focus to the tab that contains their site every second...
不,你不能这样做。无法使用 Javascript 或任何类型的客户端脚本在选项卡之间切换。这是应该的。我不希望网站控制我使用浏览器的方式。
如果您希望拥有可以通过编程方式在选项卡之间切换的选项卡,则必须在浏览器窗口中自行实现它们。
No. You cannot do this. There is no way to switch between tabs using Javascript, or any kind of client scripting. That's as it should be. I don't want websites controlling the way I use my browser.
If you want to have tabs that you can switch between programmatically, you'll have to implement them yourself within the browser window.
由于安全原因,您无法在 JavaScript 中发送系统级密钥。
You can't send system level keys in javascript due to security reasons.