[Sugar-devel] [GSoC] I need help for Webified - SSB activity favicons

Tomeu Vizoso tomeu at sugarlabs.org
Wed Jul 1 04:54:08 EDT 2009


On Thu, Jun 25, 2009 at 02:56, Lucian Branescu<lucian.branescu at gmail.com> wrote:
> In case you don't know what Webified is
> http://wiki.sugarlabs.org/go/Webified http://honeyweb.wordpress.com
>
> In short, I have added to Browse the ability to create SSB
> (http://en.wikipedia.org/wiki/Site-specific_browser) activities.
>
> Since I'm generating activities, they need to have icons. After some
> discussions, I have decided to use a .svg wrapper icon for all SSBs
> that includes the website favicon.
>
>
> I need to extract the favicon from a website and include it in the
> .svg icon. Any thoughts?

Can SVG images contain bitmaps? Because I guess that most sites will
be using a PNG or GIF.

> Right now, I'm doing
>
> <code>
> cls = components.classes['@mozilla.org/network/io-service;1']
> io_service = cls.getService(interfaces.nsIIOService)
> ns_uri = io_service.newURI(uri, None, None)
>
> cls = components.classes['@mozilla.org/browser/favicon-service;1']
> favicon_service = cls.getService(interfaces.nsIFaviconService)
>
> favicon_service.getFaviconData(ns_uri)
> </code>
>
> But the last line throws xpcom.Exception: -2147221231. I haven't been
> able to figure out what that error is.

At this point, I would debug the mozilla side of things. It may seems
like a pain, but may actually save you time when compared with trying
things randomly.

Another option is once you get the URI to download it (see nsChannel
components).

HTH,

Tomeu


> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list