57 Comments

Summary:

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 […]

itunes_thumb

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

The iTunes preview pages run a JavaScript function that attempts to load iTunes by opening an ITMS file. This file will launch iTunes and direct the application to open the iTunes Store to the specified content. I did not want to recommend just disabling JavaScript because that would interfere with a lot of websites that rely on the interactivity that is possible with JavaScript. We will prevent iTunes from opening by changing the way that these browsers handle the ITMS file. This approach will allow you to manually launch iTunes when you desire. In the case of Chrome, we can selectively disable JavaScript for iTunes links.

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

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.

Additional Measures

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.

Chrome

Chrome has not implemented the “about:config” settings in Chrome for Mac, but it does have a nifty feature to disable javascript on specific sites. Open Chrome’s preferences and click on the “Under the Hood” tab.

Click on “Content Settings…” and then select the “JavaScript” tab.

Click on “Exceptions” and then use the “+” button to add “itunes.apple.com” and make sure this site is set to block JavaScript. Now when you load an iTunes web link, the site will report that iTunes cannot be found because the JavaScript function that is looking for it has failed to run and return a result.

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.

Safari Update

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.

  1. Thanks for this. It was starting to become annoying.

  2. Great tip and I couldn’t agree more with the reasoning behind it. I never understood why iTunes had to open as well. Awesome there is a way around it.

  3. This doesn’t work for me with Safari. ITunes always keeps reclaiming that extension, even after a manually tell it to use the non-preferred app Safari (instead of iTunes) for all items with that extension

  4. Didn’t work for me with Safari, either. This has really been annoying me of late, so I was psyched to see the article. Wish it could be made to work…

  5. Anyone know how this works with IE?

  6. I see that iTunes resets the cookies and the protocol handlers for Safari. I’m working on new instructions.

  7. Too complicated. Just install and tweak RcDefaultapp system pref pane.

    http://www.rubicode.com/Software/RCDefaultApp/

    1. I can’t get it to work with RCDefaultApp as well. Where exactly shall i change things?

    2. in RCDefaultApp, click on the URL tab and then change “itms” to disabled.

    3. Thanks, everythings is working fine now!

  8. Or you could simply use GlimmerBlocker to remove the onload= parameter from all tags on itunes.apple.com. That way, web preview pages won’t even try to open iTunes. And since this is done in GlimmerBlock, it works for all browsers – no browser-specific tweaking required.

  9. Make that “remove the onload= parameter from all BODY tags”. The comment system stripped the body tag from my previous post.

    1. Mfichtner… can you provide a little more detail on exactly what needs to be done in GlimmerBlocker? I’ve never used it before and wasn’t able to figure out exactly how one goes about removing the onload parameter within the program.

    2. mcfichtner – you need to create a new filter that will match on apple.com sites and then use the transform function. I think the full expression would be something like…

      replace(/ onload=”[^"]+”, “”);

  10. This Greasemonkey script does the trick as well… and yes, it works perfectly with Safari and Greasekit.

    http://userscripts.org/scripts/show/66948

  11. iFUN.de/iPhone :: Alles zum iPhone − Automatischen iTunes-Start beim Aufruf von AppStore-Links verhindern Tuesday, March 16, 2010

    [...] bei TAB hat man sich Gedanken um die bessere Nutzung der von Apple eingeführten iTunes Vorschau-Seiten [...]

  12. The Easier Alternative To Manage Your iPod Without iTunes | Buy 4 Less 4 You MP3 Players Tuesday, March 16, 2010

    [...] How-To: Stop iTunes Web Links From Opening iTunes [...]

  13. iTunes Start beim Aufrufen von iTunes Store Links verhindern « guyslife.de Tuesday, March 16, 2010

    [...] Die Lösung ist so einfach wie logisch. Über den Link wird eine itms Datei geöffnet, die daraufhin iTunes startet. Nun muss man einfach nur die Browsereinstellung manipulieren und das entsprechende JavaScript Snippet “verhindern”. Hier geht’s zur Anleitung… [...]

  14. Chrome 5.0.307.11 beta on Mac OS X 10.6.2 seem to not have these buttons under ‘Under the Hood/Privacy’. With all the other ‘not workings’ I’m left wondering if the author has thoroughly vetted his “solution”.

    1. I’m using Chrome 5.0.342.3 dev. The Safari instructions do not stick, but this section will get updated.

  15. Dica: como configurar o seu navegador para não abrir o iTunes automaticamente em links da web | MacMagazine Tuesday, March 16, 2010

    [...] para Mac: Safari, Firefox e Chrome. Cada um tem um modo de funcionamento distinto, então corra lá e confira como configurar o seu! [...]

  16. Não Abrir o iTunes ao Acessar Links em Seu Navegador « Mundo Touch Tuesday, March 16, 2010

    [...] para Mac: Safari, Firefox e Chrome. Cada um tem um modo de funcionamento distinto, então corra lá e confira como configurar o seu! GD Star Ratingloading… Marcadores: Dicas, iTunes, Navegadores, Tutoriais Compartilhe este [...]

  17. The GreaseKit script is still not working with my Snow Leopard & Safari setup.

    1. Is GreaseKit installed? As in, you can see the menu?

    2. Yep, the menu is there and all looks to be correct, but no joy on the functionality.

      I’ll give the RCDefaultApp a try…

    3. Silly question, but I gotta ask… do you see a checkmark to the left of the script name, in the GreaseKit menu? If not, it’s not enabled.

    4. Yes, it was checked & enabled. I know, I know, troubleshooting 101. Still… :-)

      It was plugged in and everything… :-)

    5. I’ve used the posted Greasemonkey scripts before (with GreaseKit) and I found that they worked if you clicked directly on a link that matched their URL rules.

      The problem I found is that a lot of links to the store are redirected from elsewhere (usually affiliate links), and for whatever reason GreaseKit or the scripts don’t catch those, so the request to open iTunes gets through (not sure how Greasemonkey handles it). I temporarily got around this by adding a URL rule for every different link I came across but that got tedious as hell.

      I used to use SafariStand to just disable JS (like the Chrome tip) but it made the page look kind of ugly in the process. RCDefaultApp is a better way of doing it…the problem with both is that when you actually want to open iTunes, they disable the ability to open it from the preview page.

  18. Someone created an extension for Chrome that make it easier: https://chrome.google.com/extensions/detail/oookoagggbojjfppmpolekejedpkjkmi

  19. I used the “stop itunes” script found here: http://userscripts.org/topics/49084 for Firefox and got the results explained here but I want the exact opposite, I want to see the link ONLY opened in itunes and not Firefox, so I don’t have to come back and close the worthless page that Firefox opened. Any help would be appreciated.

  20. Prevent iTunes web previews from opening iTunes automatically | Marthee's Tech News Thursday, March 25, 2010

    [...] have a "View in iTunes" link already, so if I want to open iTunes, it's easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn't seem to always work for me. Some [...]

  21. Prevent iTunes web previews from opening iTunes automatically Thursday, March 25, 2010

    [...] have a "View in iTunes" link already, so if I want to open iTunes, it's easy enough to do manually. The Apple Blog posted some instructions for doing this, but it didn't seem to always work for me. Some links still [...]

  22. Prevent iTunes web previews from opening iTunes automatically | oQlz Blog Thursday, March 25, 2010

    [...] have a "View in iTunes" link already, so if I want to open iTunes, it's easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn't seem to always work for me. Some [...]

  23. Prevent iTunes web previews from opening iTunes automatically | Touch the Apple Thursday, March 25, 2010

    [...] have a "View in iTunes" link already, so if I want to open iTunes, it's easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn't seem to always work for me. Some [...]

  24. Prevent iTunes web previews from opening iTunes automatically | Free iPad – One Time Offer! Thursday, March 25, 2010

    [...] in iTunes” link already, so if I want to open iTunes, it’s easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn’t seem to always work for me. [...]

  25. Prevent iTunes web previews from opening iTunes automatically | Design City Thursday, March 25, 2010

    [...] in iTunes” link already, so if I want to open iTunes, it’s easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn’t seem to always work for me. [...]

  26. Prevent iTunes web previews from opening iTunes automatically « Apple « Apple News Fan Page Thursday, March 25, 2010

    [...] couple already, so if we wish to open iTunes, it’s easy sufficient to do manually. The Apple Blog posted a little instructions for we do this, though which process didn’t appear to regularly [...]

  27. Prevent iTunes web previews from opening iTunes automatically « Apple News Daily Thursday, March 25, 2010

    [...] in iTunes" link already, so if I want to open iTunes, it's easy enough to do manually. The Apple Blog posted some instructions for doing this, but that method didn't seem to always work for me. [...]

  28. Prevent iTunes web previews from opening iTunes automatically « PacmanRetro Thursday, March 25, 2010

    [...] links do not seem to work after making this change. You will have to open/search iTunes manually.) The Apple Blog posted some instructions for doing this, but that method didn’t seem to always work for me. [...]

  29. Cómo prevenir que iTunes se abra automáticamente en la página de Preview | Hogargeek Friday, March 26, 2010

    [...] solucionar esto, The Apple Blog nos comparte un método sencillo para prevenir esto y sólo abrir iTunes cuando haces click en el [...]

  30. How to Stop iTunes Preview Links from Automatically Opening iTunes [Annoyances] | AniChaos.com Friday, March 26, 2010

    [...] list. If you’ve got a better method for handling this, let’s hear it in the comments. How-To: Stop iTunes Web Links From Opening iTunes [The Apple [...]

  31. How-to: Stop iTunes preview link to open iTunes « +Me Friday, March 26, 2010

    [...] For Safari users, check out the article written by the folks over at theAppleBlog. [...]

  32. Opera works in the same way as Chrome – Prefs, Advanced, Content, Manage Site Preferences – Add – itunes.apple.com – Scripting tab – unclick enable.

  33. [Tuto]Comment stopper de l’ouverture d’iTunes Lorsque vous ouvrez la version Web de l’iTunes Store | iPhonFun – L'iPhone Version Fun Saturday, March 27, 2010

    [...] le web, vous devriez regarder dans le moteur de recherche iTunes. Pour plus d’informations consulter ce tuto. Visite : [...]

  34. News from Appland « Murder Manual Sunday, March 28, 2010

    [...] Speaking of bad, links to the iTunes web site — which launches the iTunes application when you have the misfortune of landing on it — are my nominee for the new Web Links of Great Regret (unlabeled PDF links being the past champion). Oh no, I’m on iTunes! Halp! Such a disaster. Here’s some help: How-To: Stop iTunes Web Links From Opening iTunes. [...]

  35. BlogBuzz April 3, 2010 Friday, April 2, 2010

    [...] How-To: Stop iTunes Web Links From Opening iTunes [...]

  36. Did anyone get Glimmerblocker to work? The HTML code to block is:

    I tried MFICHTNER’s “replace” code below in the Transform field but it didn’t work. (Did I need to restart any app or computer?) I’m thinking the regex might be a bit off, but my Java Regex skills are non-existent.

    TIA

  37. I got it to work with Glimmerblocker. Really great now. Surfing the iTMS and AppStore via a browser is pretty nice, actually.

    Steps:
    1) Create a new filter in Glimmerblocker system pref pane.
    2) Settings on Rule Type tab: Rule enabled, priority: 2, Whilelist URL (that is what I chose), and then “Host…. is “.
    3) in the Host field I put, “itunes.apple.com”
    4) other fields are blank
    5) Click to Transform tab and enter

    replace(/onload=”detectAndOpenItunes();/,””);

    That should work. Basically I’m just removing the auto open call. The button “Open in iTunes” still works.

    Hope that helps someone. Been bothering me for ages.

  38. Otwieranie linków z App Store w przeglądarce i zablokowanie włączania iTUnes Tuesday, May 18, 2010

    [...] How-To: Stop iTunes Web Links From Opening iTunes U mnie działa – testowałem na Firefox'ie Komputer: Toshiba Satellite A350-13A + Win7 Pro [...]

  39. Anyone wanna take a shot at a Safari 5 extension? That would be awesome.

  40. Re: Safari 5 Extension: Totally agree. I already have been working on it, but it looks like I need to get a certificate to test the plugin out. Yesterday Apple’s dev website wasn’t working. I’ll try again soon, but it might be a week or two before I really find the time again. Someone else should take a poke if they have the time first!

    What I did find out: I think you need to to add a “Start Script” that removes the “onload=” parameter from the BODY tag. I think it should be pretty easy to do. Maybe there are other approaches, but this one is pretty straightforward and still allows for the “Open in iTunes” button on the webpage to work.

  41. Stop iTunes web links from opening iTunes – OS X Daily Thursday, June 10, 2010

    [...] What about stopping iTunes links in Chrome and Firefox? In Chrome you simply add a domain block to itunes.apple.com within Javascript Exceptions and they stop. In FireFox you make a few changes in the about:config advanced preference area, you can see how to do both of these in detail at TheAppleBlog: How to stop iTunes web links. [...]

  42. Victor G. Reano Sunday, June 27, 2010

    Well done, Weldon. For a company that prides itself on usability and great user experiences, I find it strange that Apple allows such annoying behavior from hyperlinks.

  43. thank you so very much….

  44. Bart Schuller Friday, July 23, 2010

    For Safari 5 this extension is created specifically for this purpose: http://einserver.de/nomoreitunes/

  45. iTunes jak zrobić by się automatycznie nie włączał ? Wednesday, September 22, 2010

    [...] 30s w gugle i… http://theappleblog.com/2010/03/15/h…pening-itunes/ Komputer: MacBook Pro 13,3" 2,26GHz (Snow Leo 10.6.4) Odtwarzacz: iPod Touch 2G [...]

  46. iTunesリンクをiTunesを起動させずにストレスフリーでSafariで開く方法 « Miapch! Friday, September 24, 2010

    [...] How-To: Stop iTunes Web Links From Opening iTunes: Apple « 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. link: Full Article… [...]

Comments have been disabled for this post