Skip to content

Instantly share code, notes, and snippets.

@jsantell
Created April 25, 2013 21:37
Show Gist options
  • Save jsantell/5463394 to your computer and use it in GitHub Desktop.
Save jsantell/5463394 to your computer and use it in GitHub Desktop.
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