如何从可插入协议处理程序中检测主页URL [英] How to detect the main page url from within a pluggable protocol handler
问题描述
我正在实现可插拔协议处理程序在我自己的浏览器应用程序中,以阻止广告.确切地说,它是一个名称空间处理程序.我可以轻松地从名称空间处理程序中获取要下载的元素的url.但是我想获取包含该元素的页面的URL.我正在构建的浏览器应用程序可以在一个过程中托管许多Web浏览器控件.目前,我不知道哪种方法可以判断哪个Web浏览器控件发出了下载请求.
I am implementing a pluggable protocol handler in my own browser application for the purpose of blocking ads. It's a namespace handler to be exact. I can easily get the url of the element being dowloaded from within the namespace handler. But I would like to get the URL of the page which contains the element as well. The browser app I am building hosts many web browser controls in a single process. At this moment, I don't know any way to tell which web browser control issues the download request.
非常感谢您提出解决方案的有用技巧.
Thanks a lot for any useful tips leading to the solution.
推荐答案
在iinternetprotocolroot开始中使用GetBindString将为您提供页面的网址.
Using GetBindString in iinternetprotocolroot start will give you the url of the page.
pIBindInfo->GetBindString(BINDSTRING_URL, .., .., ..);
这篇关于如何从可插入协议处理程序中检测主页URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!