daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Aug 17th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Retrieving the favicon url of the websites from firefox extension
  2. var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"]
  3.                                .getService(Components.interfaces.nsIFaviconService);
  4. var favicon = faviconService.getFaviconImageForPage(gBrowser.currentURI);
  5. alert(favicon.spec);
  6.    
  7. nsIServiceManager serviceManager =
  8. Mozilla.getInstance().getServiceManager();
  9. nsIFaviconService service =
  10. (nsIFaviconService)serviceManager.getServiceByContractID("@mozilla.org/brows
  11. er/favicon-service;1", nsIFaviconService.NS_IFAVICONSERVICE_IID);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top