Finds a website’s favicon URL, if any. Requires a context, like a browser extension, that allows cross-origin requests.
<script type="text/javascript" src="favicon.js"></script>
<script type="text/javascript">
var favicon = new Favicon;
favicon.get('https://disconnect.me/', function(url) {
jQuery('#favicon').attr('src', url);
// favicon.js automagically loads jQuery.
});
</script>
<img id="favicon" width="16" height="16" src="default.png" alt="A favicon.">
A class for finding a website’s favicon URL, if any.
alt
A default favicon URL, absolute or relative.
Fetches the default favicon URL.
An absolute or relative URL.
Mungs the default favicon URL.
alt
An absolute or relative URL.
The favicon object.
Finds a favicon URL.
url
A website’s absolute URL or hostname.
callback
A continuation, to execute when the method completes, that takes a
favicon URL.
The favicon object.
Copyright 2012, 2013 Disconnect, Inc.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.