在地址栏中检索浏览器的URL [英] Retrieve browser's URL in address bar

查看:155
本文介绍了在地址栏中检索浏览器的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在浏览器的地址栏中检索文本?
我的应用程序知道(例如)Opera浏览器已启动,并且它是活动窗口.我需要知道当前网页的URL.

How can I retrieve the text in a browser''s address bar?
My application knows that (for example) Opera browser is launched, and it is the active window. I need to know the URL of current web page.

推荐答案

可以支持Opera编写插件.
对于IE,我们编写了一个名为Browser Helper Object(BHO)的插件,该插件可以获取URL以及导航到新URL时的任何通知.
You could write plugins for Opera if it supports it.
For IE, we write a plugin called a Browser Helper Object (BHO) which can get the URL and any notifications like when navigating to a new URL.


您必须使用SPY ++来查找Opera地址栏的窗口句柄,然后使用Windows消息以某种方式在该窗口中检索文本.
You would have to use SPY++ to find the window handle of the Opera address bar, and then somehow retrieve the text in that window using a windows message.


您可以在java脚本中使用location.href来返回当前页面'' s url ....希望对您有帮助
you can use location.href in java script which returns the current page''s url.... hope this helps


这篇关于在地址栏中检索浏览器的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆