[webkit-dev] How to execute a JavaScript containing site with JSCore?

Sebastian Linke Seb_Linke at web.de
Sat Jun 13 01:40:41 PDT 2009


Actually I was focussing on how a context is created based on the html code of 
a website.

Is there a straigthforwarded way to collect all the relationships between the 
site's object and to get a js-context of it?

What I want in the end is to get access on the `document`-element, e.g. to 
perform calls like `document.forms`.

Sebastian


> Hi Sebastian.
> 
> JSEvaluateScript can only evaluate JavaScript; it can't parse HTML.
> 
> Cheers,
> Geoff
> 
> On Jun 10, 2009, at 10:05 PM, Sebastian Linke wrote:
> 
> > Hi,
> 
> > based on my experiences when I ran some javascript code on a webkit
> > context,
> > I was trying to do the same with "normal" html code.
> 
> > It may sound a bit naive, but I simply passed the whole content of a
> > website
> > to `JSEvaluateScript()`, using `JSGlobalContextCreate(NULL)` as the
> > context.
> 
> > This did - as almost expected - not work. The only result I got back
> > was
> > `undefined`.
> 
> > So my question is: How does webkit handle this? In what kind of way
> > is a
> > javascript containing website given to the js engine to get back the
> > right
> > result after code execution (e.g. today's date displayed on the
> > screen)?
> 
> > Or do things not go the way I think about and there is no html
> > generated
> > return value sent from JSCore? (Hope you know what I mean...)
> 
> > Regards
> 
> > Sebastian
> 
> > PS: My code example: http://paste.pocoo.org/show/122370/
> > ___________________________________________________________________
> > WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
> > Telefonanschluss für 17,95 Euro/mtl.! http://produkte.web.de/go/02/
> 
> > _______________________________________________
> > webkit-dev mailing list
> > webkit-dev at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> 
___________________________________________________________________
WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und 
Telefonanschluss für 17,95 Euro/mtl.! http://produkte.web.de/go/02/



More information about the webkit-dev mailing list