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?
基础教程推荐
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
