Created
July 29, 2010 13:05
-
-
Save satyr/498059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: 'test favicon', | |
preview: function(pb){ | |
const FS = (Cc['@mozilla.org/browser/favicon-service;1'] | |
.getService(Ci.nsIFaviconService)); | |
var uri = Utils.uri(CmdUtils.document.URL); | |
try { var faviconUri = FS.getFaviconForPage(uri) } catch([]) {} | |
var dataUrl = faviconUri && FS.getFaviconDataAsDataURL(faviconUri); | |
pb.innerHTML = <><img src={dataUrl}/><br/>{dataUrl}</>; | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment