By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,213 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,213 IT Pros & Developers. It's quick & easy.

Trying to get a scripting environment for a WebBrowserClass object

P: n/a

I'm trying to port a toolbar from Firefox to IE. Right now, the part
I'm working on is the toolbar's page manipulation functionality, which
is all written in Javascript. Since I want to be able to share a lot
of code between the Firefox edition (written in Javascript and XUL)
and the IE edition (written in C#), I would like to execute this
Javascript in the context of the page.

My first attempt involved using the execScript method of the
IHTMLWindow2 that I got from calling mshtml.HTMLDocument.parentWindow.
However, this method seems to execute the code in the security domain
of the current page, which causes breakage in some of the scripts.
Additionally, I would really like to have a persistent environment
(similar to the Firefox chrome environment) which is unrestricted and
which persists between pages, but which can access and modify state in
the same scripting environment as the currently loaded page (I hope
this makes sense).

My current tack is attempting to do this through the
IHTMLDocument.Script property, but I'm not sure if this implements
IActiveScript or not (and, if so, where IActiveScript is defined...).
Is this going to yield fruitful results? Any recommendations on how to
do this cleanly (or at all)?


Feb 2 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.