How to get the url of currently opened tabs in all browsers with php or javascript?(如何使用 php 或 javascript 获取所有浏览器中当前打开的选项卡的 url?)
问题描述
如果有人可以指导一下或对如何使它成为可能知之甚少,请告诉我.
If anyone can guide a bit or have little knowledge how to make it possible, please let me know.
谢谢
推荐答案
您不能,此信息无法通过任何标准界面获得(除了您已经参考的窗口).你可以看到为什么.您不希望您的一个标签的网站所有者能够知道您所有其他标签的显示内容,这将大量侵犯您的隐私.
You can't, this information is just not available via any standard interface (except for a window you already have a reference to). You can see why. You wouldn't want the site owner for one of your tabs to be able to know what all your other tabs were showing, that would be a massive invasion of your privacy.
对于您已经引用的窗口,您可以获取该窗口正在显示的任何内容的 URL (window.location.href
),也可能是其父窗口的 URL (window.parent.location.href
)、顶级 (window.top.location.href
) 和下级框架 (window.frames[n].location.href
— 我想).但这不会让你得到你要求的标签.
For windows you already have a reference to, you can get the URL of whatever that window is showing (window.location.href
), and possibly that of its parent window (window.parent.location.href
), top-level (window.top.location.href
), and subordinate frames (window.frames[n].location.href
— I think). But that's not going to get you the tabs you asked for.
此信息可能通过各种浏览器的扩展机制(Firefox 插件、Chrome 扩展等)获得,但这仅适用于需要用户显式安装的浏览器扩展,并且(目前) 需要为每个浏览器供应商编写一个,并非所有供应商都提供扩展机制.
This information is likely available via the extension mechanism of various browsers (Firefox add-ins, Chrome Extensions, etc.), but that would be only for a browser extension, which requires an explicit install from the user, and (currently) requires writing one for each browser vendor, where not all vendors offer an extension mechanism.
另外:此信息肯定不会发送到服务器端(您标记了您的问题 php
).
Separately: This information is certainly not sent server-side (you tagged your question php
).
这篇关于如何使用 php 或 javascript 获取所有浏览器中当前打开的选项卡的 url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 php 或 javascript 获取所有浏览器中当前打开的选项卡的 url?
基础教程推荐
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01