3/12/14

CONTROL + COMMAND + D Dictionary Command Not Working In Safari

I'm sitting in front of Safari 5.1.10 on a Snow Leopard system on a long road trip and noticed on a few sites that I visit hitting the key combo of Control + Command + D which brings up a handy pop-up dictionary didn't work. I had lots of time to hurry up and wait on this trip so I decided to find out why.

Short version: It seems to be caused by substitution fonts injected into a page from another source. In the few cases I looked into it is caused by typekit.com not playing nice with OS X's Services.

Long version:

Control + Command + D is a Service, and oddly, one that's not listed in System Preferences > Keyboard > Services, that brings up a handy pop-up dictionary definition of the word the cursor is currently over. I use it very often in my research.

It works on some sites and not others and it turns out the culprit are services that replace the font on a page with another "universal" one. A popular site that supplies these fonts is typekit.com.

Here's how I stopped it, but in the process made some web pages slightly less...refined looking.

Method One:

Edit your host file to block the offending site, in this case typekit.com. See my post about how to properly edit your hosts file here.

Method Two:

Use a free service like OpenDNS to block the offending domain.

Method Three:

Block the Javascript that accepts the font code from the offending site.

There are many many ways to block Javascripts but for Safari a free and fairly easy way is JavaScript Blocker you can get for free here.

1. Load up the offending site.
2. Click on Javascript Blocker's button in your Safari Toolbar and look for

use.typekit.com

and

typekit.com

Block both scripts and reload the problem page and test the dictionary short cut. Javascript Blocker provides a way to just block the script temporarily in case it causes a problem. If it seems to be working, make it permanent (you can always change it later) and you should be good to go.

The only issue I've noticed so far with this is that web sites that use custom fonts won't look as intended but I actually think they're often (but not always) more legible with the font script blocked.


No comments: