如何获取 Firefox/IE/Chrome 中可见选项卡的 URL?

发布于 2024-09-17 12:29:50 字数 350 浏览 1 评论 0原文

不,这不是向我发送代码请求。

我正在为自己的娱乐编写一个小实用程序。在这方面,我需要该实用程序从当前打开的三个浏览器(Firefox、IE、Chrome)中任意一个的可见/活动选项卡中读取 URL,然后对该 URL 执行某些操作。

我假设我需要 PInvoke 来处理某些内容,可能是 EnumWindows、GetForegroundWindow 或类似的东西。我在 Win32 API 方面有丰富的经验,但目前,我需要摸索一下,因为我已经很久没有吃过它们当午餐了,并且习惯于将阅读 SDK 文档作为一种娱乐和手段。娱乐。

我正在尝试考虑从活动浏览器的活动选项卡的地址栏中检索文本的方法。任何正确方向的指示将不胜感激。

No, this is not a send me teh codez request.

I am writing a small utility for my own amusement. In this regard, I need the utility to read the URL from the visible/active tab on any of the three browsers (Firefox, IE, Chrome) that are currently open, and then go off and do something with that URL.

I am assuming I'll need to PInvoke for some of the stuff, may be EnumWindows, or GetForegroundWindow or some such. I've ample experience in Win32 API, but at the moment, I'll need to poke around a bit as it's been a long time since I used to have them for lunch, and used to read SDK documentation as a means of entertainment and amusement.

I am trying to think of ways of retrieving the text from the active browser's active tab's address bar. Any pointers in the right direction will be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她比我温柔 2024-09-24 12:29:50

好吧,这个 示例 使用 EnumChildWindows,但您可能无法让它在 UAC 中工作- 启用、低权限 IE 世界。

Well, this example uses EnumChildWindows, but you may have trouble getting it to work in a UAC-enabled, Low Rights IE world.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文