I created a Browser Helper Object for IE8 in order to run a javascript located on my computer. Like browser extensions work in other browsers. I'm trying to execute the following code:
IHTMLWindow2* pWindow;
doc->get_parentWindow(&pWindow);
hr = pWindow->execScript((BSTR)"var d=window.document,\
s=d.createElement('script'),\
h=d.getElementsByTagName('body')[0];\
s.src='file:///L:/prg/Web/ieplugin/ieplugin.js';\
h.appendChild(s);",
(BSTR)"JavaScript", &vResult);
But the result is E_INVALIDARG, which is caused most likely by the script address. Is it possible to run the script from my computer without lowering security settings for Internet Zone? I tried to set security settings for Trusted Sites to minimum and added to trusted sites 'file://localserver', but to no avail.
EDIT: More specifically, I get the following error message within the IE window:
Message: Invalid character
Line: 1
Char: 1
Code: 0
URI: file:///L:/prg/Web/ieplugin/ieplugin.js