Since it is usually at the root of the site and has always the name favicon.ico you could get it using an HTTPSocket.
thanks. Yeas i know, but my idea was take the host url by java script, for example, the favicon of google is “http://www.google.com/favicon.ico” , but if i go to google images, the url is “https://www.google.com.ar/imghp?hl=es-419&tab=wi&ei=WC9OVc_jOcnbsASUtoHYDg&ved=0CA8Qqi4oAg” so i can’t take the favicon. i need to take the url in google images, but without all the text after the “/”. Do You understand it?
(I put google images as example)