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

Carl Lobo carllobo at gmail.com
Thu Dec 23 23:29:59 PST 2010


Hi Again Xuan,
I think the expected output is what you should get if you just load
the code in in the webview. I'm not sure what exactly you are trying
to do. If you are trying to get something out of the DOM it's best to
do by evaluating some JS I guess.
-Carl


On Fri, Dec 24, 2010 at 12:36 PM, Xuan Zhang <xuan.zhang1911 at gmail.com> wrote:
> 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
>> >
>> >
>
>


More information about the webkit-help mailing list