简体   繁体   English

如何获取Firefox / IE / Chrome中可见标签的URL?

[英]How do I get the URL of the visible tab in Firefox/IE/Chrome?

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. 在这方面,我需要该实用程序从当前打开的三个浏览器(Firefox,IE,Chrome)中的任何一个的“可见/活动”选项卡中读取URL,然后关闭并对该URL进行处理。

I am assuming I'll need to PInvoke for some of the stuff, may be EnumWindows, or GetForegroundWindow or some such. 我假设我需要PInvoke一些东西,可能是EnumWindows或GetForegroundWindow或类似的东西。 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. 我在Win32 API方面拥有丰富的经验,但是目前,我需要回顾一下,因为我过去很长时间以来一直将它们用作午餐,并且习惯于阅读SDK文档作为娱乐和娱乐的手段。娱乐。

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. 任何朝着正确方向的指针将不胜感激。

好的,此示例使用EnumChildWindows,但是您可能很难使它在启用UAC的低权限IE世界中运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#如何为外部浏览器中的每个浏览器选项卡获取唯一PID,即。 铬/火狐/ IE - C# How do I get unique PID for each browser tab in external browser ie. Chrome/Firefox/IE 如何在Firefox / IE / Chrome中检测自定义插件? - How do I detect a custom plugin in Firefox/IE/Chrome? 使用C#given hwnd获取Chrome,Firefox和IE中的当前URL - Get current URL in Chrome, Firefox and IE using C# given hwnd 如何从适用于 IE 和 FireFox 的 asp.net 文件上传控件获取文件名? - How do i get the file name from an asp.net fileupload control that works in IE and FireFox? 当使用Chrome或IE登录Umbraco 5后台时,我被重定向回登录页面,但Firefox可以吗? - When logging into the Umbraco 5 back office using Chrome or IE, I get redirected back to the login page but Firefox is fine? 如何使用c#在Chrome中获取当前的HTML标签? - How do to Get current HTML tab in Chrome with c#? 如何创建可以找到Chrome或Firefox实例的DesiredCapabilities? - How do I create a DesiredCapabilities that can find a Chrome or Firefox instance? 如何从 Chrome 和 Firefox 获取打开页面的 URL? - How can I get URLs of open pages from Chrome and Firefox? 如何杀死特定的chrome选项卡/进程 - How do I kill a particular chrome tab/process C#如何将标签页与Firefox或Google Chrome这样的tabcontrol分开? - C# How can I separate a tab from tabcontrol like Firefox or Google Chrome?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM