From: Vasudevan C. <vco...@gm...> - 2015-08-07 13:24:38
|
Hi Ahmed, Thanks for your reply. The JS that I receive from google recaptcha service is generating one value and I need that value. The JS uses only window.atob, window.btoa methods. If I use a java base64 encode/decode functions and remove the reference to window object, will I be able to use JDK embedded Rhino Engine and get the same value without using window object? Your suggestion is very much appreciated. or Am I doing something which is not worth doing? Regards Vasu On 6 August 2015 at 17:11, Ahmed Ashour <asa...@ya...> wrote: > Hi Vasu, > > You can't use HtmlUnit to get ScriptObject and then pass it to Rhino > Engine, the two JS engines are in different java packages. > > If you have an issue with HtmlUnit JS engine, then please post a test case. > > Ahmed > ------------------------------ > *From:* Vasudevan Comandur <vco...@gm...> > *To:* "htm...@li..." < > htm...@li...> > *Sent:* Wednesday, August 5, 2015 6:59 PM > *Subject:* [Htmlunit-user] How to allow window.atob and window.btoa > methodexecution in HTML Unit from JS > > > Hi All, > > I am using the default JS engine that is bundled with JDK 1.6 (Rhino > Engine). > > I have been trying to use the methods supported by javax.script.* > classes to > execute the javascript methods. One of the javascript files use > window.atob and > window.btoa functions and that was throwing exception since window > object was > undefined. > > I used HTMLUnit to instantiate a webClient and followed by > getScriptObject to > get the Window object. This window object was passed to JS using > engine.put > method. > > I was not getting the expected results after window.atob call in JS. I > also > tried printing the window object using window.toString(). I saw the > signature > of the atob method but the not code inside the method. > > What should I do in JS so that window.atob function defined in HTMLUnit > under > WIndow class gets executed correctly. > > Looking forward to your help and suggestions to solve this problem. > > > Regards > Vasu > > PS: I am not using the JS engine bundled with HTMLUnit. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |