[Sugar-devel] [GSoC] I need help for Webified - SSB activity favicons
Lucian Branescu
lucian.branescu at gmail.com
Wed Jun 24 21:56:49 EDT 2009
I've tried more methods from here
https://developer.mozilla.org/en/nsIFaviconService
getFaviconImageForPage() and getFaviconLinkForIcon() work and they
return URIs to the favicon. However, getFaviconData(
getFaviconLinkForIcon() ) still gives an exception.
I have looked at the URIs returned by getFaviconImageForPage() and
getFaviconLinkForIcon() and they're both the default favicon. This
means getFaviconData( getFaviconImageForPage() ) should work, but it
still doesn't. It also means that Browse doesn't collect favicons.
I could resort to getting /favicon.ico, but it's not very standard and
.ico is an annoying format. I would also not account for any <meta>
tags that may define icons. I was also hoping of using xulrunner's
image handling and get the base64 image from it instead of processing
an image file.
2009/6/25 Lucian Branescu <lucian.branescu at gmail.com>:
> 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?
>
>
> 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.
>
More information about the Sugar-devel
mailing list