[webkit-help] Newbie Help: getting parsed html (javascript aware) using webkit

Xuan Zhang xuan.zhang1911 at gmail.com
Thu Dec 23 23:06:37 PST 2010


Hi Carl,

Thanks for your reply. I am reading the code for a while. But it seems that
I don't make the question clear enough. :(

Instead of evaluating javascript, I am trying to parse the html & running
javascript to modify the html at the same time.
Much like what cobra is doing. (but unfortunately, it contains some bug
there).

For example,
Input is a html file as
<html>
<body>
<script type="text/javascript">
document.write("Hello World!");
</script>
</body>
</html>

The expected output should be:
<html>
<body>
<script type="text/javascript">
document.write("Hello World!");
</script>
Hello World!
</body>
</html>

I am looking at html/parser/HTMLDOMParser.h. But I haven't found a clue.
Did you come across the same problem or similiar one?

Looking forward to your reply.

Best,
Xuan


On Fri, Dec 24, 2010 at 1:38 AM, Carl Lobo <carllobo at gmail.com> wrote:

> Hi,
> I suppose you can get the JSGlobalContextRef of the
> IWebFrame::globalContext() and then evaluate javascript using the
> JSEvaluateScript function defined in JSBase.h.
> Regards,
> Carl
>
> On Fri, Dec 24, 2010 at 11:43 AM, Xuan Zhang <xuan.zhang1911 at gmail.com>
> wrote:
> > Hi all,
> >
> > I am a newbie in webkit. I am working on a project which basically want
> to
> > get the parsed html (javascript) from webkit programmatically.
> >
> > Basically, I am trying to get the result of webinspector in a
> programatical
> > way. I search a lot on google but it seems this topic is not so popular.
> > I think it will be a api somewhere but I am not so familiar with webkit
> and
> > still in the parse of searching
> >
> > Best,
> > Xuan
> > _______________________________________________
> > webkit-help mailing list
> > webkit-help at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20101224/c30aa4ce/attachment-0001.html>


More information about the webkit-help mailing list