gpt4 book ai didi

java - 我可以获取任何其他浏览器窗口的 URL 吗?

转载 作者:行者123 更新时间:2023-12-02 00:47:08 27 4
gpt4 key购买 nike

我想读取所有打开的窗口的网址。 window 一关上,我也应该知道。

实现此目的的一种方法是要求用户下载 Firefox 插件。该插件应监控用户网址。

但这可能吗?如何去执行它。我的 Java 和 PHP 水平相当不错。

编辑:

如果用户想要授予访问他或她访问的所有网站的权限怎么办?我想以直观的方式显示授予权限的用户访问的网站的统计信息。

最佳答案

如上所述,出于安全和隐私原因,无法使用在页面内运行的标准 JavaScript/DOM 方法来完成此操作。

您绝对可以使用 Firefox 附加组件、插件或扩展来做到这一点。

我建议阅读Firefox addons developer guideDeveloper Hub一般来说。用于开发 Firefox 的语言是 JavaScript。

nsIWindowMediator可以用来枚举打开的窗口,属性可以通过nsIDOMWindow获取对象。正如所解释的here ,

"While you can use JavaScript to get child windows opened from the parent window, you cannot get dialogs or windows that have no relation to that window. To overcome this limitation, nsIWindowMediator makes it possible to access all of Firefox's windows."

关于java - 我可以获取任何其他浏览器窗口的 URL 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4654164/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com