A piece I wrote last week on the impact of iTunes web preview pages on App Store SEO brought up a little side conversation about how many people found it annoying that the links launch iTunes automatically. Sometimes you don’t even have any warning that the link is going to launch iTunes if you click on a shortened link. There are a few simple steps that you can take to stop this behavior and suppress iTunes in its eagerness to run and take you to the page for that app (or other iTunes content).
Below, I have outlined the steps for Safari, Firefox, and Chrome.
The Basic Concept
Safari (see update below)
Safari uses the helper applications as defined in the “Get Info” dialog box for each file type. In Snow Leopard, Mac OS X relies solely on the file’s extension to determine the default application. This may behave differently in 10.5, which still respects the creator code attribute.
Create a simple text file on your desktop. The content of the file does not matter. Rename that file to “test.itms” and confirm that you do want to change the extension. Now select that file and pull up the “Get Info” dialog box (Command-I, right-click, or File » Get Info).
The “Open with:” section should show “iTunes.app (default)” at first. Click on the pull down menu there, select “Other” and then pick Safari. You will have to enable “All Applications” in the file selection dialog box. Clicking “Add” will return you to the “Get Info” window. Be sure to click “Change All…” to have that behavior work for any ITMS file, including ones you may download from iTunes web links in the future.
You must log out and back in for these changes to take effect. Restarting the computer would accomplish the same result.
You can still launch iTunes by clicking on the “View in iTunes” button on the preview page.
To reverse the setting, go back to the ITMS file (or create a new one) and change the “Open With” entry to iTunes.app and then click “Change All…” to make sure it will be used in all cases.
Firefox uses a different method to define the helper app. Open a new browser window or tab and type “about:config” into the address bar. After dismissing the warning, you will be presented with a long list of options. Fortunately, we can use the search box at the top of this window to filter the results down to just the option we need. Type “itms” in the filter box and you will see an entry for “network.protocol-handler.warn-external.itms” as the only result (if you don’t get any results, keep reading for a solution). Double-click on the “false” entry below the “Value” column and change it to “true” and then close the window or tab. Restart Firefox to make sure the change is saved and used the next time you launch Firefox.
Now you should get a dialog box asking you what you want to do about this content type when you go to page. Click “Cancel” to prevent iTunes from opening or click “OK” to launch iTunes into the iTunes Store. Do NOT check the “Remember my choice for itms links” box or iTunes will automatically launch in the future. Unfortunately, I did not see this dialog box come up consistently, but here is what it should look like.
What if I don’t have an an “itms” entry in about:config?
If you do not have an entry for “network.protocol-handler.warn-external.itms” in the “about:config” page, do not panic. You can add a new entry by right-clicking on the page and selecting “New: Boolean” from the pop-up menu.
Type “network.protocol-handler.warn-external.itms” into the preference name field and click “OK” to create the entry.
The next step is to make sure the boolean value itself is set to “true” so that Firefox will ask what you want to do with iTunes links.
If iTunes still launches automatically, check the settings in the applications tab of the Firefox preferences window and search for “itunes” in the filter box. If any content types are set to open with iTunes, change those settings to “Always Ask” and this should stop iTunes from opening. To double-check, do another search on “itms” and make sure it is set to “Always Ask” here as well.
To reverse the setting, return to the “about:config” page and double-click on the “true” entry for “network.protocol-handler.warn-external.itms” to change it back to “false” and disable the dialog box asking you what to do.
While this solution works to shut down iTunes, it also means that you cannot click on the “View on iTunes” button on the page to launch iTunes manually. If you really want to get to the iTunes Store, copy the URL from the address bar and open the same page in Safari, or simply launch iTunes manually and search in the store.
To reverse the setting, return to the list of exceptions and delete the entry for “itunes.apple.com” by clicking on the “–” button.
No More Autolaunching!
Automatically launching applications and slowing down my computer is almost as annoying as websites that start playing background music when you visit or DVD’s that play ads for soft drinks that cannot be stopped when all you want to do is watch a movie. Well, not nearly as bad as the stupid discs that will not let you skip to the movie, but still annoying. The steps above will help you take back control.
Many of you have reported that Safari/iTunes seem to reset our little fix, so here are some additional options for those experiencing this issue.
Safari relies on the Finder to define the default applications in the “Get Info” dialog box for each file type and the system to define the default helper application for URL schemes like “itms://” used by iTunes. With Chrome and Firefox, we can use settings within the app itself. With Safari, we have to modify the way the system deals with the files and URLs or add a plug-in to Safari itself.
Some may want to check out GlimmerBlocker which works by installing a proxy server on your local machine. All web requests from any application will be routed through this proxy. When the web page is returned to the requesting application, the page can be rewritten according to rules defined in the proxy.
Another approach is to change the system URL schemes for “itms://” to block Safari from launching iTunes even though the script still runs on the preview page. To do this, you will need to install RCDefaultApp and disable the “itms” URL type.
I did not want to modify the way the system deals with all HTTP requests or install a System PreferencePane. I chose to use GreaseKit, a Greasemonkey extension for Safari. After you install GreaseKit, you will need to install a script to block iTunes from launching on web preview pages. There is an existing script that will do this, but it includes some minor advertising for apptrackr.com. I wrote a simplified script that you can install to Stop iTunes from autolaunching that does not modify any other elements of the preview pages. This script will also work with Greasemonkey on Firefox.