c++ - 即用户代理wxWidgets

标签 c++ internet-explorer com wxwidgets user-agent

我目前正在使用 ie 作为 wxWidgets 上的事件 x com 事物,并且想知道是否有任何简单的方法来更改始终有效的用户代理。

Atm 我正在更改标题,但这仅在我手动加载链接(即调用 setUrl)时有效

最佳答案

据我所知,“始终有效”的唯一方法是 changing the user-agent string in the registry 。当然,这会影响该计算机上运行的每个 Web 浏览器实例。

您还可以尝试在 DISPID_AMBIENT_USERAGENT 上进行 Google 搜索。来自 this Microsoft page :

MSHTML will also ask for a new user agent via DISPID_AMBIENT_USERAGENT when navigating to clicked hyperlinks. This ambient property can be overridden, but it is not used when programmatically calling the Navigate method; it will also not cause the userAgent property of the DOM's navigator object or clientInformation behavior to be altered - this property will always reflect Internet Explorer's own UserAgent string.

我不熟悉 MSHTML 组件,因此我不确定这是否有帮助。

我希望这至少能为您提供一个起点。 :-)

关于c++ - 即用户代理wxWidgets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/233911/

相关文章:

c++ - 找到黑白图像的边缘

javascript - JQuery show() 在 Internet Explorer/Chrome 中延迟

c# - 防止 COM 名称重整

interface - 为什么 AddRef() 和 Release() 的返回类型不是 HRESULT

c++ - 在它自己的指针上模板化一个类?

c++ - "return {...}; "在 C++11 中如何工作?

c++ - 我怎样才能防止每个键都被发送到 GLUT 中的 KeyboardUpFunc?

javascript - 突出显示电话号码并用标签 javascript 括起来

css - IE 中主要内容左侧的奇怪空格

windows - Spectre/Meltdown 补丁导致 COM 方法返回 E_ACCESSDENIED