How to detect the main page url from within a pluggable protocol handler

我怕爱的太早我们不能终老 提交于 2020-02-07 12:27:47

问题


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.


回答1:


Using GetBindString in iinternetprotocolroot start will give you the url of the page.

pIBindInfo->GetBindString(BINDSTRING_URL, .., .., ..);


来源:https://stackoverflow.com/questions/12717365/how-to-detect-the-main-page-url-from-within-a-pluggable-protocol-handler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!