[Greasemonkey] Parsing html - another way
Aaron Boodman
zboogs at gmail.com
Sun Mar 19 18:59:51 EST 2006
Wooo interesting....
I might include something like this in a future Greasemonkey version. Good idea.
- a
On 3/19/06, Hrvoje Prgeša <hrvoje.prgesa at fer.hr> wrote:
> Since I don't like using iframes or innerHTML for loading and parsing
> html (and I couldn't get it to work for the pages I needed it) I made
> another way to do it:
>
> I made a simple XPCOM object in C++ (50 lines of code) that I can call
> from my extension javascript - it accepts normal html and forwards it to
> "Tidy HTML" library which converts it to XHTML/XML. From there on I can
> use the normal DOMParser or anything else :)
>
> I might work in GM too if you can execute something like this (this
> works in a normal extension - I have no idea how GM works):
> const cid = "@mipis.hr/HtmlHelpers/HtmlToXml;1"
> var obj = Components.classes[cid].createInstance();
> obj = obj.QueryInterface(Components.interfaces.IHtmlToXml);
> var pureXHtml = obj.convertHtmlToXml(html);
>
> So if anyone is interested...
>
> Preview - vBulletin forum "first post" preview on icon mouseover:
> http://img226.imageshack.us/img226/8008/dfifox6pi.jpg
>
>
> H.
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
More information about the Greasemonkey
mailing list