[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-user
Subject:    Re: [Htmlunit-user] HtmlUnit with Canvas and jQuery 1.9.0
From:       "matt () raibledesigns ! com" <matt () raibledesigns ! com>
Date:       2013-02-07 19:23:56
Message-ID: 06B0D116-1F1A-405E-813C-FAB9E389D716 () raibledesigns ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Feb 7, 2013, at 2:19 AM, Marc Guillemot [via HtmlUnit] \
<ml-node+s10904n30106h4@n7.nabble.com> wrote:

> Hi Matt, 
> 
> if you can provide a way to reproduce the errors you get, we can perhaps 
> have a look at them. 

You can see the app I'm trying to compile on the server at:

http://static.raibledesigns.com/mc/app/index.html

My goal is to have a filter that precompiles on the server and gives the full HTML \
app to the user, initialized with data and click events. I don't know if this is \
possible, but it seems reasonable.

> 
> A few words concerning performance: 
> 
> - for HtmlUnit, the correct simulation of the specified browser has 
> higher priority than the performance, nevertheless most of the time I 
> hear from users that HtmlUnit is fast or at least "fast enough". This 
> being said, performance improvements are always welcome 
> 
> - you can easily use your own WebConnection to directly feed HtmlUnit 
> with content and skip HTTP requests. The MockWebConnection may be the 
> right thing for you. 

I was able to use the following method using a StringWebResponse. Is the \
MockWebConnection a better way?

http://stackoverflow.com/questions/6136435/how-to-create-htmlunit-htmlpage-object-from-string


URL url = new URL(req.getRequestURL().toString());
StringWebResponse html = new StringWebResponse(content, url);

WebClient client = new WebClient();
HtmlPage page = HTMLParser.parseHtml(html, client.getCurrentWindow());

String xml = page.asXml();

This does seem to work - however, I'm having issues getting the html from the \
response. I've tried the following recommendation, but the content is always empty:

http://stackoverflow.com/questions/701681/how-can-i-read-an-httpservletreponses-output-stream


> 
> - if you compare the performance of HtmlUnit vs the simulated browser, 
> remember to compare the same thing: a new WebClient instance will have 
> an empty cache whereas your "real" browser will probably have a primed cache 

I've written some tests to see what the difference is b/w fetching via URL via \
reading a string. It looks like reading from a String is 3x as fast (3 seconds vs. \
9).

https://gist.github.com/mraible/4733381

> 
> - you can "cache the Cache" to let HtmlUnit have a primed cache too by 
> reusing the same WebClient instance (but it can be used only from a 
> single thread at a time) or by configuring a shared 
> com.gargoylesoftware.htmlunit.Cache instance (take care that the size is 
> high enough). This would allow avoid HTTP requests and JS parsing. 

That's a good idea, especially since the CSS and JS won't change per user. The JSON \
might - is there any way to cache certain requests and not others? Do you have an \
example?

Thanks,

Matt

> 
> - HtmlUnit uses Rhino in interpreted mode. Personally my experiments 
> have never showed an improvement by using the compiled mode but a user 
> once reported me that it was the case for him. 
> 
> Cheers, 
> Marc. 
> -- 
> HtmlUnit support & consulting from the source 
> Blog: http://mguillem.wordpress.com
> 
> Le 07/02/2013 01:16, [hidden email] a écrit :
> 
> > 
> > On Feb 6, 2013, at 12:55 AM, Marc Guillemot [via HtmlUnit] <[hidden 
> > email] </user/SendEmail.jtp?type=node&node=30105&i=0>> wrote: 
> > 
> > > Hi Matt, 
> > > 
> > > as explained by Ronald, the invalid selector message is normal. In fact 
> > > we should probably remove the current StrictErrorReporter as it is 
> > > misleading. 
> > > 
> > > The warnings 
> > > 
> > > > com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify 
> > > > WARNING: Obsolete content type encountered: 'application/x-javascript'. 
> > > 
> > > don't matter either. 
> > > 
> > > But this one is interesting and we should probably investigate it: 
> > > 
> > > > com.gargoylesoftware.htmlunit.WebConsole$DefaultLogger warn 
> > > > WARNING: JQMIGRATE: jQuery is not compatible with Quirks Mode 
> > 
> > I believe this is just a warning from jQuery Migrate that some of the JS 
> > in my page is deprecated. 
> > 
> > > 
> > > 
> > > > Switching to jQuery 1.8.3 causes the same error as 1.9.1, but the 
> > > client 
> > > > doesn't hang and the process page is returned. 
> > > 
> > > Is it hanging with a recent 2.12-SNAPSHOT? If yes, could you provide us 
> > > a stack dump? 
> > 
> > No, with the latest 2.12-SNAPSHOT (I built from source), the following 
> > error occurs with 1.9.0+ 
> > 
> > Feb 6, 2013 5:07:10 PM 
> > com.gargoylesoftware.htmlunit.WebConsole$DefaultLogger error 
> > SEVERE: Error: Template must have exactly one root element. was: <div></div> 
> > 
> > > 
> > > > 3. I'm using a canvas-based clock in my app 
> > > > (http://randomibis.com/coolclock/) and it causes the following error 
> > > when 
> > > > parsing: 
> > > > 
> > > > ======= EXCEPTION START ======== 
> > > > EcmaError: lineNumber=[193] column=[0] lineSource=[null] 
> > > name=[TypeError] 
> > > > sourceName=[http://localhost:8000/coolclock/coolclock.js] 
> > > > message=[TypeError: Cannot find function rotate in object [object 
> > > > CanvasRenderingContext2D]. 
> > > > ... 
> > > > 
> > > > It looks like this issue was reported (and fixed?), yet it's 
> > > happening for 
> > > > me when using HtmlUnit 2.11. 
> > > > 
> > > > http://sourceforge.net/p/htmlunit/bugs/1138/
> > > the issue was about the translate method. The rotate method was missing. 
> > > I've just added it (an empty placeholder in fact) and this will be 
> > > available in the next snapshot when the build server has finished. 
> > 
> > This works now, but moment.js does not. Not sure why as it works fine 
> > when I don't try to process it with HtmlUnit: 
> > 
> > <script type="text/javascript"> 
> > $(document).ready(function() { 
> > setInterval(function () { 
> > $('.date').text(moment().format('MMMM Do YYYY, h:mm:ss a')); 
> > }, 1000); 
> > </script> 
> > 
> > > 
> > > > 
> > > > Thanks in advance for any workarounds. 
> > > 
> > > with HtmlUnit-2.12-SNAPSHOT you should try to simulate FF17 rather than 
> > > FF10. FF10 simulation will be abandoned. 
> > 
> > I've changed to this and I'm still seeing errors with Highcharts: 
> > 
> > Feb 6, 2013 5:07:23 PM 
> > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine 
> > handleJavaScriptException 
> > INFO: Caught script exception 
> > ======= EXCEPTION START ======== 
> > EcmaError: lineNumber=[121] column=[0] lineSource=[null] 
> > name=[TypeError] 
> > sourceName=[http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344] \
> >  message=[TypeError: Cannot set property "onclick" of undefined to 
> > "function (c) { 
> > c = b(new a.Point(c != null ? c.clientX : event.clientX, c != null 
> > ? c.clientY : event.clientY)); 
> > a.Mouse.onclick(c.x, c.y); 
> > }" 
> > (http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121)] 
> > com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set 
> > property "onclick" of undefined to "function (c) { 
> > c = b(new a.Point(c != null ? c.clientX : event.clientX, c != null 
> > ? c.clientY : event.clientY)); 
> > a.Mouse.onclick(c.x, c.y); 
> > }" 
> > (http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121) 
> > at 
> > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669) \
> >  at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:601) 
> > at 
> > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507) \
> >  at 
> > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:601) \
> >  at 
> > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:576) \
> >  at 
> > com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:1005) \
> >  
> > The reason I started looking into HtmlUnit was because it seemed like 
> > the most recommended way to process JS on the server when using Java. 
> > I'm actually impressed with how well it does and I'm able to process my 
> > AngularJS app on the server and return a populated page rather than 
> > waiting for it to hit the client and then contact the server for data. 
> > 
> > However, the problem I've found is that using HtmlUnit to process things 
> > takes about 5 seconds whereas if I just load up the HTML (with Angular), 
> > it takes about 1 second. This could be because my laptop is fast, but I 
> > also believe it's b/c HtmlUnit's WebClient has to refetch the HTML from 
> > the server (even though it's already on the server). Looking through the 
> > API, it doesn't look like it's possible to instantiate an HtmlPage from 
> > an existing String of HTML, so I don't know if processing JS on the 
> > server is going to work for me. If I could process the JS on the server 
> > in milliseconds, that'd be a different story. 
> > 
> > 
> 
> 
> ------------------------------------------------------------------------------ 
> Free Next-Gen Firewall Hardware Offer 
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more. 
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________ 
> Htmlunit-user mailing list 
> [hidden email] 
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://htmlunit.10904.n7.nabble.com/HtmlUnit-with-Canvas-and-jQuery-1-9-0-tp30076p30106.html
>  To unsubscribe from HtmlUnit with Canvas and jQuery 1.9.0, click here.
> NAML





--
View this message in context: \
http://htmlunit.10904.n7.nabble.com/HtmlUnit-with-Canvas-and-jQuery-1-9-0-tp30076p30111.html
 Sent from the HtmlUnit - General mailing list archive at Nabble.com.


[Attachment #5 (text/html)]

<meta http-equiv="Content-Type" content="text/html \
charset=iso-8859-1"><br><div><div>On Feb 7, 2013, at 2:19 AM, Marc Guillemot [via \
HtmlUnit] &lt;<a href="/user/SendEmail.jtp?type=node&node=30111&i=0" target="_top" \
rel="nofollow" link="external">[hidden email]</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote style='border-left:2px solid \
#CCCCCC;padding:0 1em' type="cite">

	Hi Matt,
<br><br>if you can provide a way to reproduce the errors you get, we can perhaps 
<br>have a look at them.
<br></blockquote><div><br></div>You can see the app I'm trying to compile on the \
server at:</div><div><br></div><div><a \
href="http://static.raibledesigns.com/mc/app/index.html" target="_top" rel="nofollow" \
link="external">http://static.raibledesigns.com/mc/app/index.html</a></div><div><br></div><div>My \
goal is to have a filter that precompiles on the server and gives the full HTML app \
to the user, initialized with data and click events. I don't know if this is \
possible, but it seems reasonable.</div><div><br><blockquote style='border-left:2px \
solid #CCCCCC;padding:0 1em' type="cite"><br>A few words concerning performance: \
<br><br>- for HtmlUnit, the correct simulation of the specified browser has  \
<br>higher priority than the performance, nevertheless most of the time I  <br>hear \
from users that HtmlUnit is fast or at least "fast enough". This  <br>being said, \
performance improvements are always welcome <br><br>- you can easily use your own \
WebConnection to directly feed HtmlUnit  <br>with content and skip HTTP requests. The \
MockWebConnection may be the  <br>right thing for you.
<br></blockquote><div><br></div>I was able to use the following method using a \
StringWebResponse. Is the MockWebConnection a better way?</div><div><br></div><div><a \
href="http://stackoverflow.com/questions/6136435/how-to-create-htmlunit-htmlpage-object-from-string" \
target="_top" rel="nofollow" \
link="external">http://stackoverflow.com/questions/6136435/how-to-create-htmlunit-htmlpage-object-from-string</a></div><div><br></div><div><div><div>URL \
url = new URL(req.getRequestURL().toString());</div><div>StringWebResponse html = new \
StringWebResponse(content, url);</div><div><br></div><div>WebClient client = new \
WebClient();</div><div>HtmlPage page = HTMLParser.parseHtml(html, \
client.getCurrentWindow());</div><div><br></div><div>String xml = \
page.asXml();</div><div><br></div><div>This does seem to work - however, I'm having \
issues getting the html from the response. I've tried the following recommendation, \
but the content is always empty:</div><div><br></div><div><a \
href="http://stackoverflow.com/questions/701681/how-can-i-read-an-httpservletreponses-output-stream" \
target="_top" rel="nofollow" \
link="external">http://stackoverflow.com/questions/701681/how-can-i-read-an-httpservletreponses-output-stream</a></div><div><br></div></div><blockquote \
style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><br>- if you compare \
the performance of HtmlUnit vs the simulated browser,  <br>remember to compare the \
same thing: a new WebClient instance will have  <br>an empty cache whereas your \
"real" browser will probably have a primed cache <br></blockquote><div><br></div>I've \
written some tests to see what the difference is b/w fetching via URL via reading a \
string. It looks like reading from a String is 3x as fast (3 seconds vs. \
9).</div><div><br></div><div><a href="https://gist.github.com/mraible/4733381" \
target="_top" rel="nofollow" \
link="external">https://gist.github.com/mraible/4733381</a></div><div><br></div><div><blockquote \
style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><br>- you can "cache \
the Cache" to let HtmlUnit have a primed cache too by  <br>reusing the same WebClient \
instance (but it can be used only from a  <br>single thread at a time) or by \
configuring a shared  <br>com.gargoylesoftware.htmlunit.Cache instance (take care \
that the size is  <br>high enough). This would allow avoid HTTP requests and JS \
parsing. <br></blockquote><div><br></div>That's a good idea, especially since the CSS \
and JS won't change per user. The JSON might - is there any way to cache certain \
requests and not others? Do you have an \
example?</div><div><br></div><div>Thanks,</div><div><br></div><div>Matt</div><div><br><blockquote \
style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><br>- HtmlUnit uses \
Rhino in interpreted mode. Personally my experiments  <br>have never showed an \
improvement by using the compiled mode but a user  <br>once reported me that it was \
the case for him.&nbsp;</blockquote><blockquote style='border-left:2px solid \
#CCCCCC;padding:0 1em' type="cite"><br>Cheers, <br>Marc.
<br>-- 
<br>HtmlUnit support &amp; consulting from the source
<br>Blog: <a href="http://mguillem.wordpress.com/" target="_top" rel="nofollow" \
link="external">http://mguillem.wordpress.com</a><br><br>Le 07/02/2013 01:16, &lt;a \
href=&quot;x-msg://3794/user/SendEmail.jtp?type=node&amp;amp;node=30106&amp;amp;i=0&quot; \
target=&quot;_top&quot; rel=&quot;nofollow&quot; link=&quot;external&quot;&gt;[hidden \
email]</a> a écrit : <div class="shrinkable-quote"><div \
class='shrinkable-quote'><br>&gt; <br>&gt; On Feb 6, 2013, at 12:55 AM, Marc \
Guillemot [via HtmlUnit] &lt;[hidden <br>&gt; email] \
&lt;/user/SendEmail.jtp?type=node&amp;node=30105&amp;i=0&gt;&gt; wrote: <br>&gt;
<br>&gt;&gt; Hi Matt,
<br>&gt;&gt;
<br>&gt;&gt; as explained by Ronald, the invalid selector message is normal. In fact
<br>&gt;&gt; we should probably remove the current StrictErrorReporter as it is
<br>&gt;&gt; misleading.
<br>&gt;&gt;
<br>&gt;&gt; The warnings
<br>&gt;&gt;
<br>&gt;&gt; &gt; com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
<br>&gt;&gt; &gt; WARNING: Obsolete content type encountered: \
'application/x-javascript'. <br>&gt;&gt;
<br>&gt;&gt; don't matter either.
<br>&gt;&gt;
<br>&gt;&gt; But this one is interesting and we should probably investigate it:
<br>&gt;&gt;
<br>&gt;&gt; &gt; com.gargoylesoftware.htmlunit.WebConsole$DefaultLogger warn
<br>&gt;&gt; &gt; WARNING: JQMIGRATE: jQuery is not compatible with Quirks Mode
<br>&gt;
<br>&gt; I believe this is just a warning from jQuery Migrate that some of the JS
<br>&gt; in my page is deprecated.
<br>&gt;
<br>&gt;&gt;
<br>&gt;&gt;
<br>&gt;&gt; &gt; Switching to jQuery 1.8.3 causes the same error as 1.9.1, but the
<br>&gt;&gt; client
<br>&gt;&gt; &gt; doesn't hang and the process page is returned.
<br>&gt;&gt;
<br>&gt;&gt; Is it hanging with a recent 2.12-SNAPSHOT? If yes, could you provide us
<br>&gt;&gt; a stack dump?
<br>&gt;
<br>&gt; No, with the latest 2.12-SNAPSHOT (I built from source), the following
<br>&gt; error occurs with 1.9.0+
<br>&gt;
<br>&gt; Feb 6, 2013 5:07:10 PM
<br>&gt; com.gargoylesoftware.htmlunit.WebConsole$DefaultLogger error
<br>&gt; SEVERE: Error: Template must have exactly one root element. was: \
&lt;div&gt;&lt;/div&gt; <br>&gt;
<br>&gt;&gt;
<br>&gt;&gt; &gt; 3. I'm using a canvas-based clock in my app
<br>&gt;&gt; &gt; (<a href="http://randomibis.com/coolclock/" target="_top" \
rel="nofollow" link="external">http://randomibis.com/coolclock/</a>) and it causes \
the following error <br>&gt;&gt; when
<br>&gt;&gt; &gt; parsing:
<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt; ======= EXCEPTION START ========
<br>&gt;&gt; &gt; EcmaError: lineNumber=[193] column=[0] lineSource=[null]
<br>&gt;&gt; name=[TypeError]
<br>&gt;&gt; &gt; sourceName=[<a href="http://localhost:8000/coolclock/coolclock.js" \
target="_top" rel="nofollow" \
link="external">http://localhost:8000/coolclock/coolclock.js</a>] <br>&gt;&gt; &gt; \
message=[TypeError: Cannot find function rotate in object [object <br>&gt;&gt; &gt; \
CanvasRenderingContext2D]. <br>&gt;&gt; &gt; ...
<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt; It looks like this issue was reported (and fixed?), yet it's
<br>&gt;&gt; happening for
<br>&gt;&gt; &gt; me when using HtmlUnit 2.11.
<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt; <a href="http://sourceforge.net/p/htmlunit/bugs/1138/" \
target="_top" rel="nofollow" \
link="external">http://sourceforge.net/p/htmlunit/bugs/1138/</a><br>&gt;&gt; the \
issue was about the translate method. The rotate method was missing. <br>&gt;&gt; \
I've just added it (an empty placeholder in fact) and this will be <br>&gt;&gt; \
available in the next snapshot when the build server has finished. <br>&gt;
<br>&gt; This works now, but moment.js does not. Not sure why as it works fine
<br>&gt; when I don't try to process it with HtmlUnit:
<br>&gt;
<br>&gt; &lt;script type="text/javascript"&gt;
<br>&gt; &nbsp; &nbsp; &nbsp;$(document).ready(function() {
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setInterval(function () {
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;$('.date').text(moment().format('MMMM Do YYYY, h:mm:ss a')); <br>&gt; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp;}, 1000); <br>&gt; &lt;/script&gt;
<br>&gt;
<br>&gt;&gt;
<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt; Thanks in advance for any workarounds.
<br>&gt;&gt;
<br>&gt;&gt; with HtmlUnit-2.12-SNAPSHOT you should try to simulate FF17 rather than
<br>&gt;&gt; FF10. FF10 simulation will be abandoned.
<br>&gt;
<br>&gt; I've changed to this and I'm still seeing errors with Highcharts:
<br>&gt;
<br>&gt; Feb 6, 2013 5:07:23 PM
<br>&gt; com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine
<br>&gt; handleJavaScriptException
<br>&gt; INFO: Caught script exception
<br>&gt; ======= EXCEPTION START ========
<br>&gt; EcmaError: lineNumber=[121] column=[0] lineSource=[null]
<br>&gt; name=[TypeError]
<br>&gt; sourceName=[<a \
href="http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344" \
target="_top" rel="nofollow" \
link="external">http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344</a>]
 <br>&gt; message=[TypeError: Cannot set property "onclick" of undefined to
<br>&gt; "function (c) {
<br>&gt; &nbsp; &nbsp; &nbsp;c = b(new a.Point(c != null ? c.clientX : event.clientX, \
c != null <br>&gt; ? c.clientY : event.clientY));
<br>&gt; &nbsp; &nbsp; &nbsp;a.Mouse.onclick(c.x, c.y);
<br>&gt; }"
<br>&gt; (<a href="http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121" \
target="_top" rel="nofollow" \
link="external">http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121</a>)]
 <br>&gt; com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set
<br>&gt; property "onclick" of undefined to "function (c) {
<br>&gt; &nbsp; &nbsp; &nbsp;c = b(new a.Point(c != null ? c.clientX : event.clientX, \
c != null <br>&gt; ? c.clientY : event.clientY));
<br>&gt; &nbsp; &nbsp; &nbsp;a.Mouse.onclick(c.x, c.y);
<br>&gt; }"
<br>&gt; (<a href="http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121" \
target="_top" rel="nofollow" \
link="external">http://code.highcharts.com/2.3.5/modules/canvas-tools.js?_=1360195643344#121</a>)
 <br>&gt; at
<br>&gt; com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669)
 <br>&gt; at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:601)
 <br>&gt; at
<br>&gt; net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
 <br>&gt; at
<br>&gt; com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:601)
 <br>&gt; at
<br>&gt; com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:576)
 <br>&gt; at
<br>&gt; com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:1005)
 <br>&gt;
<br>&gt; The reason I started looking into HtmlUnit was because it seemed like
<br>&gt; the most recommended way to process JS on the server when using Java.
<br>&gt; I'm actually impressed with how well it does and I'm able to process my
<br>&gt; AngularJS app on the server and return a populated page rather than
<br>&gt; waiting for it to hit the client and then contact the server for data.
<br>&gt;
<br>&gt; However, the problem I've found is that using HtmlUnit to process things
<br>&gt; takes about 5 seconds whereas if I just load up the HTML (with Angular),
<br>&gt; it takes about 1 second. This could be because my laptop is fast, but I
<br>&gt; also believe it's b/c HtmlUnit's WebClient has to refetch the HTML from
<br>&gt; the server (even though it's already on the server). Looking through the
<br>&gt; API, it doesn't look like it's possible to instantiate an HtmlPage from
<br>&gt; an existing String of HTML, so I don't know if processing JS on the
<br>&gt; server is going to work for me. If I could process the JS on the server
<br>&gt; in milliseconds, that'd be a different story.
<br>&gt;
<br>&gt;
</div></div><br>------------------------------------------------------------------------------
 <br>Free Next-Gen Firewall Hardware Offer
<br>Buy your Sophos next-gen firewall before the end March 2013 
<br>and get the hardware for free! Learn more.
<br><a href="http://p.sf.net/sfu/sophos-d2d-feb" target="_top" rel="nofollow" \
link="external">http://p.sf.net/sfu/sophos-d2d-feb</a><br>_______________________________________________
 <br>Htmlunit-user mailing list
<br>&lt;a href=&quot;x-msg://3794/user/SendEmail.jtp?type=node&amp;amp;node=30106&amp;amp;i=1&quot; \
target=&quot;_top&quot; rel=&quot;nofollow&quot; link=&quot;external&quot;&gt;[hidden \
email]</a> <br><a href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user" \
target="_top" rel="nofollow" \
link="external">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a><br>

	
	
	
	<br>
	<br>
	<hr noshade="noshade" size="1">
	<div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
		<div style="font-weight:bold">If you reply to this email, your message will be \
added to the discussion below:</div>  <a \
href="http://htmlunit.10904.n7.nabble.com/HtmlUnit-with-Canvas-and-jQuery-1-9-0-tp30076p30106.html" \
target="_top" rel="nofollow" \
link="external">http://htmlunit.10904.n7.nabble.com/HtmlUnit-with-Canvas-and-jQuery-1-9-0-tp30076p30106.html</a>
  </div>
	<div style="color:#666; font: 11px \
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">  
		To unsubscribe from HtmlUnit with Canvas and jQuery 1.9.0, <a href="" target="_top" \
rel="nofollow" link="external">click here</a>.<br>  <a \
href="http://htmlunit.10904.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer& \
amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespa \
ce-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp \
;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" \
rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>  \
</div></blockquote></div><br>

	
	
	
<br/><hr align="left" width="300" />
View this message in context: <a \
href="http://htmlunit.10904.n7.nabble.com/HtmlUnit-with-Canvas-and-jQuery-1-9-0-tp30076p30111.html">Re: \
HtmlUnit with Canvas and jQuery 1.9.0</a><br/> Sent from the <a \
href="http://htmlunit.10904.n7.nabble.com/HtmlUnit-General-f20847.html">HtmlUnit - \
General mailing list archive</a> at Nabble.com.<br/>



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic