如何从Internet Explorer扩展(BHO)中注入Javascript并执行AJAX调用 [英] How to inject Javascript and perform AJAX calls from within an Internet Explorer extension (BHO)

查看:486
本文介绍了如何从Internet Explorer扩展(BHO)中注入Javascript并执行AJAX调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我写了这个在父窗口中执行Javascript的函数,但它不是很可靠。例如,它适用于www.bing.com,但不适用于www.google.com。知道为什么吗?

Hello,

I wrote this function that executes Javascript in the parent window, but it is not very reliable. For instance it works in www.bing.com but not in www.google.com. Any idea why?

HRESULT JS_InsertInline(wstring script)
{
	VARIANT vrt			= { 0 };		
	return win2->execScript(SysAllocStringLen(script.data(), script.size()), L"javascript", &vrt);
}





知道为什么?我尝试使用 IHTMLScriptElement ,但我不知道怎么用C ++做...





关于AJAX,我发现的唯一一件事就是this 。信息不多。有关于如何通过函数发出AJAX请求的示例或文章吗?





谢谢



Any idea why? I tried using IHTMLScriptElement, but I have no idea how to do it in C++...


Regarding AJAX, the only thing I found was this. Not much information. Are there any examples or articles on how I could make an AJAX request from withing the function?


Thank you

推荐答案

这篇关于如何从Internet Explorer扩展(BHO)中注入Javascript并执行AJAX调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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