On Sep 2, 11:43 am, Ahmed Ashour <[EMAIL PROTECTED]> wrote: > Dear Oren, > > Did you have a look at HtmlUnit? > > Yours, > Ahmed > > ----- Original Message ---- > From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Sent: Tuesday, September 2, 2008 11:34:56 AM > Subject: Importing document and window from client browser to Rhino > > Hello, > > I am trying to use Rhino as a proxy between a browser and an ad- > server, to be able to examine the ad code before outputting to the > browser (for example, to prevent showing adult content ads, and there > can be of course more reasons). > > So in the site, instead of calling <script src="ad-server-delivery"... > I call <script src="rhino-proxy"... when "rhino-proxy" is a script > that executes a Rhino shell, that calls the original "ad-server- > delivery". > > The problem is, that the ad-server usually delivers some html that > contains more <script> tags, and these in turn need several things > from the browser, like window.location, document.write, cookies and > whatnot... > > I am beginning to think that what I'm trying to do is impossible, > because I need the whole original browser environment in the Rhino > shell. I tried using John Resig's env.js, but it cannot parse the > reponse html, and it does not fully create the document and window of > the original browser. > > Any thoughts? > Oren > _______________________________________________ > dev-tech-js-engine-rhino mailing list > [EMAIL PROTECTED]://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
Hi Ahmed, I did take a look at HtmlUnit, but I didn't find a way to pass the original client environment onto HtmlUnit. I might have missed something. Also, it seems HtmlUnit implements only old browsers (FF 1.5...) and that it is more oriented on testing. The more I think about it, it seems highly unreasonable to try and import the whole DOM and environment to a server-side JS shell. I thought about serializing the document object and passing it as a parameter, but it's a little far-fetched, no? Oren _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
