Highlight external links with favicons

Many sites like to apply distinct styling to their external links to let users know they will leave the site if they click on them. Wikipedia is a good example of this, using a blue box-arrow icon applied as a background image to links with the "external" class.

A slight more colourful approach would be to use the target website's favicon. This not only makes for an arguably more visually appealing design, but in certain circumstances, allows users to quickly see to which domain a link will probably take them:

BeforeAfter
External links styled with an icon (left) and with the target site's favicon (right)

This can be achieved using a few lines of JavaScript and Google's favicon cache. Google use this technique on some of their sites and as such keeps a cache of favicons as PNGs accessible by passing the domain as a parameter to the following url:

http://s2.googleusercontent.com/s2/favicons?domain_url=[DOMAIN]

So for example:

<img src="http://s2.googleusercontent.com/s2/favicons?domain_url=http%3A//semplicewebsites.com" width="16" height="16" alt="Favicon" />

gives our favicon: Favicon. It also gives a nice fallback icon when a favicon isn't found: Favicon

The code

To being with we need our HTML...

<a href="http://www.google.com" class="external">Google</a>

... and some CSS rules...

a.external {
  padding-left: 18px;
  background: url('http://s2.googleusercontent.com/s2/favicons') left center no-repeat;
}

This also defines the fall-back icon for when JavaScript is disabled.

Then we add our JavaScript. For this I will assume that you are using a JavaScript framework that allows you to select an element with a CSS selector. In this example I am using jQuery:

$('a.external').each(function() {
  var host = $(this)[0].host.replace(':80', '');
  $(this)[0].style.backgroundImage =
    'url("http://s2.googleusercontent.com/s2/favicons?domain_url=' +
    escape('http://' + host) + '")';
});

This code is added to the bottom of the page, or a page load event. ":80" is added to the a.host value by IE6, so this is removed as it unnecessary for searching the Google cache.

If you don't have the ability to mark all your external links with a class you can change your css selector to find them automatically:

$('a[href^=http]').each(function() {
  ...
  ...
});

All scripts are Public Domain.

Comments

Thanks, super helpful! I just tucked mine into the template, and spit the url into the appropriate place. No CSS or JS necessary -- works great.

This script is what I just wanted! it works great!
But one problem: is that legal? as I tried this url < googleusercontent.com > and it was not found and I didn't found any link or resources telling that this is a public service that google provides for webmasters.
Thanks for your help.

Thanks - this is a great solution - exactly what I was looking for, except for one issue - I've specified a default image for all links via my CSS (as you've shown) but it seems that the script still replaces this with the default globe icon when there is no proper favicon.

Are you able to suggest a way of retaining my own image if there is not a proper favicon?

You'd probably have to fetch the images to your server then md5 the contents and compare it against the known md5 of the globe image.

Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil 4.0":
captcha solution of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Bing, Hotmail, SolveMedia, Yandex,
and more than 8400 another size-types of captchas,
with highest precision (80..100%) and highest speed (100 img per second).
You can use XEvil 4.0 with any most popular SEO/SMM software: iMacros, XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

Interested? There are a lot of impessive videos about XEvil in YouTube.

FREE DEMO AVAILABLE!

Good luck!

Incredible update of captchas breaking package "XRumer 16.0 + XEvil":
captchas regignizing of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Bing, Hotmail, SolveMedia, Yandex,
and more than 8400 another categories of captchas,
with highest precision (80..100%) and highest speed (100 img per second).
You can use XEvil 4.0 with any most popular SEO/SMM programms: iMacros, XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

Interested? There are a lot of introducing videos about XEvil in YouTube.

FREE DEMO AVAILABLE!

Good luck ;)

http://XEvil.net/

Incredible update of captchas breaking package "XRumer 16.0 + XEvil":
captchas regignizing of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Bing, Hotmail, SolveMedia, Yandex,
and more than 8400 another categories of captchas,
with highest precision (80..100%) and highest speed (100 img per second).
You can use XEvil 4.0 with any most popular SEO/SMM programms: iMacros, XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

Interested? There are a lot of introducing videos about XEvil in YouTube.

FREE DEMO AVAILABLE!

Good luck ;)

http://XEvil.net/

World cup 2018 russia fixtures download World cup group qualifiers predictions Fifa world cup 2018 tv schedule Livestream russia vs saudi arabia socceroos Livestream egypt vs uruguay 2018 World cup opening ceremony australian time Watch world cup on apple tv World cup qualification live stream free Fifa world cup 2018 song video Russia 2018 world cup groups table World cup schedule printable pacific time World cup google calendar Fifa world cup 2018 groups printable World cup 2018 russia qualifying groups World cup 2018 russia draw

World cup 2018 draw live channel world cup 2018 draw live watch Watch world cup live free europe world cup 2018 us tv coverage Fifa world cup 2018 groups simulator world cup schedule mexico time Morocco vs iran odds 2018 fifa world cup tickets price World cup groups 2018 wiki world cup 2018 final draw pdf

Live fifa world cup streaming Egypt vs uruguay world cup predictions World cup 2018 tv schedule telemundo World cup 2018 qualifiers pdf Fifa world cup 2018 tickets shipping World cup live stream 2018 World cup 2018 qualifying groups mexico World cup 2018 groups and bracket Fifa world cup live watch online Portugal vs spain u21 soccerway

Fifa world cup 2018 tickets world cup 2018 qualifiers bracket Live fifa world cup 2018 fifa world cup 2018 fixtures excel World cup 2018 printable bracket pdf fifa world cup 2018 teams ranking Fifa world cup 2018 tickets shipping egypt vs uruguay world cup 2018 World cup groups 2018 qualifiers world cup 2018 groups live stream

Watch fifa world cup 2018 australia World cup groups 2018 espn World cup bracket 2018 espn Fifa world cup live streaming channels World cup 2018 schedule usa time

World cup 2018 russia fixtures download World cup group qualifiers predictions Fifa world cup 2018 tv schedule Livestream russia vs saudi arabia socceroos Livestream egypt vs uruguay 2018 World cup opening ceremony australian time Watch world cup on apple tv World cup qualification live stream free Fifa world cup 2018 song video Russia 2018 world cup groups table World cup schedule printable pacific time World cup google calendar Fifa world cup 2018 groups printable World cup 2018 russia qualifying groups World cup 2018 russia draw

World cup 2018 draw live channel world cup 2018 draw live watch Watch world cup live free europe world cup 2018 us tv coverage Fifa world cup 2018 groups simulator world cup schedule mexico time Morocco vs iran odds 2018 fifa world cup tickets price World cup groups 2018 wiki world cup 2018 final draw pdf

Live fifa world cup streaming Egypt vs uruguay world cup predictions World cup 2018 tv schedule telemundo World cup 2018 qualifiers pdf Fifa world cup 2018 tickets shipping World cup live stream 2018 World cup 2018 qualifying groups mexico World cup 2018 groups and bracket Fifa world cup live watch online Portugal vs spain u21 soccerway

Fifa world cup 2018 tickets world cup 2018 qualifiers bracket Live fifa world cup 2018 fifa world cup 2018 fixtures excel World cup 2018 printable bracket pdf fifa world cup 2018 teams ranking Fifa world cup 2018 tickets shipping egypt vs uruguay world cup 2018 World cup groups 2018 qualifiers world cup 2018 groups live stream

Watch fifa world cup 2018 australia World cup groups 2018 espn World cup bracket 2018 espn Fifa world cup live streaming channels World cup 2018 schedule usa time

pharmacie en ligne

https://bit.ly/2Jcmk50

levitra prix paris
comparer viagra cialis et levitra
cialis 5 mg kullan?m sekli
comparison between viagra cialis levitra
generique viagra biogaran
forum discussion achat cialis
comparatif viagra levitra cialis
achat viagra par internet
viagra online original
meilleur site pour acheter viagra
kamagra oral jelly pharmacie
achat kamagra oral jelly belgique
cialis super active ingredients
achat cialis en ligne france
sildenafil 100 mg y alcohol
viagra online pharmacy ratings
cialis achat quebec
viagra natural mercadolivre
prix reel du levitra
acheter cialis livraison express
pharmacie discount cialis
viagra chez la pharmacie
achat levitra sur internet
forum site vente viagra
pilule viagra forum
fiabilite cialis en ligne
viagra pour femme vente ligne
kamagra oral jelly maastricht
cialis generique est il efficace
acheter vardenafil

best online pharmacy

https://bit.ly/2LWntPH

canadian tea pills tonsil stones
online pharmacy prednisone
on line pharmacy complaints
recent canadian health issues
my canadian pharmacy india
online pharmacy tech schools
online pharmacy cpd points
best drug companies in canada
canadian family meds
best-canadian-pills comreview
canadian pharmacy better than medicare
canadian pharmacy lady lake florida
online pharmacy drug bust
trends in canadian healthcare
canadian pharmacy baytril 150mg
canada old age drug coverage
master of pharmacy practice in canada
buy drug test kit in canada
canadian pharmacies forum
skyemed pharmacy online
canadian meds online
finlandia pharmacy online
canadian drugs legal us
canadian drugs online
canada customs duty less than 24 hours
online pharmacy is it legit
online pharmacy ireland

pharmacie online

https://bit.ly/2sD1GUE

ou acheter du viagra en belgique
prix cialis paris
comparaison viagra ou cialis
viagra generique dosage
generique kamagra
cialis prix boite
achat de viagra en suisse
achat levitra securise
adresse pour acheter viagra
acheter du viagra en france en ligne
acheter du viagra en europe
femme qui prend du viagra pour homme
achat de cialis tadalafil
viagra vente pharmacie
viagra prix a la pharmacie
acheter cialis a montreal
cialis acheter sur internet
commander viagra par internet
viagra online prescription
pharmacie place monge cialis
sildenafil 50 mg juvigor
generique viagra pharmacie
commander viagra belgique
le nom generique du viagra
prix officiel viagra
cialis vente libre quebec
cialis generique professionnel

Very hairy girls teens teen

Two naked girls get down on their hands and knees, side by side, so he can take turns fucking them both from behind, doggie style. Shemale gang bang bukkake climax. Roughly assfucked babe gagging on cock.
Cum in mouth blow job

Disney s recess sex

The sexy mocha skinned babes started getting a little bit bored on the bus ride to the championsip, or maybe it was the pre competition anxiety, but the girls all got really frisky and horny. Strapon Fucking Before Ballet Class. Alia Janine Busty Milf Pov.
Japanese hentai anime porn videos

Anastasiainter russian woman dating on

Liana Smiss Angel in a Red Dress. Sunny Leone Husband name is Daniel Weber and here we discuss about Sunny Leone husband Daniel Weber biography in detail. Teen boss s sister blackmailed hd and amateur f.
Full softcore movies tube

Sex with teachers and students

Teensloveblackcocks Skinny Kacy Lane Rides Big Black Cock. See how I ve share. Latina with perfect big tits is fucked sensually.
Hairy pornstar movie gallery

Am prioritize teen issues participants

Hotel housekeeping maid giving extra services. All we need is one person to step forward and share a picture. Voluptuous Hentai With Bound Chick Sex Tortur.
Dogfart double penetration latin

Carlos wearing hot pantyhose trypantyhose com

Star Slut Star Slut game. And look at that perfect ass and beautiful, sexy titties, what perfection. Masked Girl Posing And Spreading In A Studio 3d Porn Backstage.
Free ebony teen pussy pictures

Stories about a shemale doing me

From Body-to-Body massages to Jacuzzi Spa treatments, get your needs fulfilled at Blondie. Five sisters part 03. Luis Mare And Jordan Lopez From Hammerboys Tv.
Free sex pic outdoor milf

Join AMVETS Post 64 For Lunch Dawn (Hidden/ 2012) Mrgeiselhofer 14 04 30 Mixolydian] N O N E C K Adam Lambert with QUEEN Bohemian Rhapsody (Kiev) Red Panda(Tryna Explain) Epic Chicken Fight Season 10 FAMILY GUY BOE Sosa Exclusive Sit Down With Rapshack Azide Back to the War Mighty To Save Lyric Video HD Bang On! Hands High (Official Video) Scooter Song Rihanna Sex With With Me YMS: Childhood Trauma (Part 1)

Let Pretend We Re Numb Perfect Proposal Flash Mob in Leicester Square! The Weeknd (ft. Kendrick Lamar Games in Concert Donkey Kong Bad Medicine Daft Punk Within piano cover Stan Walker Purple Rain Shimotsuki Haruka mp3 Viviuun Arikushanja Dollargettaz Devilman feat. Badness Drum And Bass Father Music Video

D-jahsta System VIP download] Preview Bobby Rock TOP 100 SHORTEST Line Distributions of 2017 NightCore Ninja Steel Star Wars Admiral (Allahu Ackbars Attack Eso eso eso natalia oreiro John Frusciante Wayne (HD) Arch N Point Miguel Nandhini Sun Tv Serial Title Song Naruto Shippuden OST II The Scarlet Letter

Luke Bundrum Nanatsu No Taizai Season 2 Opening Saari Raat, Noori MEGA FUNK - NOVAS DEZEMBRO Dj Jonatas Felipe Angel Dust (Original Mix) Back 2 U Nct 127 Teminite Uprising ALBUM TRAILER] Best Classic Rock Songs of All Time Whitney Houston Love You Greatest 100 Country Songs Of

Uniqua Pretty Acoustic English Opel Corsa nurburgring Neha rajpal Reggae Remix

Join AMVETS Post 64 For Lunch Dawn (Hidden/ 2012) Mrgeiselhofer 14 04 30 Mixolydian] N O N E C K Adam Lambert with QUEEN Bohemian Rhapsody (Kiev) Red Panda(Tryna Explain) Epic Chicken Fight Season 10 FAMILY GUY BOE Sosa Exclusive Sit Down With Rapshack Azide Back to the War Mighty To Save Lyric Video HD Bang On! Hands High (Official Video) Scooter Song Rihanna Sex With With Me YMS: Childhood Trauma (Part 1)

Let Pretend We Re Numb Perfect Proposal Flash Mob in Leicester Square! The Weeknd (ft. Kendrick Lamar Games in Concert Donkey Kong Bad Medicine Daft Punk Within piano cover Stan Walker Purple Rain Shimotsuki Haruka mp3 Viviuun Arikushanja Dollargettaz Devilman feat. Badness Drum And Bass Father Music Video

D-jahsta System VIP download] Preview Bobby Rock TOP 100 SHORTEST Line Distributions of 2017 NightCore Ninja Steel Star Wars Admiral (Allahu Ackbars Attack Eso eso eso natalia oreiro John Frusciante Wayne (HD) Arch N Point Miguel Nandhini Sun Tv Serial Title Song Naruto Shippuden OST II The Scarlet Letter

Luke Bundrum Nanatsu No Taizai Season 2 Opening Saari Raat, Noori MEGA FUNK - NOVAS DEZEMBRO Dj Jonatas Felipe Angel Dust (Original Mix) Back 2 U Nct 127 Teminite Uprising ALBUM TRAILER] Best Classic Rock Songs of All Time Whitney Houston Love You Greatest 100 Country Songs Of

Uniqua Pretty Acoustic English Opel Corsa nurburgring Neha rajpal Reggae Remix

I have visited a lot of girls in Paris but could not actually share my feedback as I was quite busy for the previous few months.
Review my web site :: http://currinhinrichsen59.qowap.com/14566926/international-elite-escort-...

Add new comment