Created
April 25, 2013 21:37
-
-
Save jsantell/5463394 to your computer and use it in GitHub Desktop.
Playing with mozIAsyncFavicons
https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/mozIAsyncFavicons#getFaviconURLForPage%28%29
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
const { Cc, Ci, Cu } = require('chrome'); | |
const FaviconService = Cc["@mozilla.org/browser/favicon-service;1"]. | |
getService(Ci.nsIFaviconService); | |
const IO = Cc["@mozilla.org/network/io-service;1"]. | |
getService(Ci.nsIIOService); | |
const asyncFavicons = FaviconService.QueryInterface(Ci.mozIAsyncFavicons); | |
let url = IO.newURI('http://www.mozilla.org', null, null); | |
// PRINT: URI: null len: 0 data: type: | |
asyncFavicons.getFaviconDataForPage(url, function (aURI, aDataLen, aData, aMimeType) { | |
console.log( | |
'URI: ' + aURI, | |
'len: ' + aDataLen, | |
'data: ' + aData, | |
'type: ' + aMimeType); | |
}); | |
// PRINT: URI: null len: 0 data: type: | |
asyncFavicons.getFaviconURLForPage(url, function (aURI, aDataLen, aData, aMimeType) { | |
console.log( | |
'URI: ' + aURI, | |
'len: ' + aDataLen, | |
'data: ' + aData, | |
'type: ' + aMimeType); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment