8 Replies Latest reply: May 13, 2010 6:01 PM by EmbeddedGeek
Allan Marcus1 Level 1 Level 1 (45 points)
Is there a way to stop safari from opening the AppStore when I click on a link to an App?
  • Carolyn Samit Level 10 Level 10 (100,375 points)
    HI Allan,

    Can you please post a link here so we can see exactly what you mean? Thanks!

  • Allan Marcus1 Level 1 Level 1 (45 points)
    Sure. Go to http://www.defenderchronicles.com/ and click on the Available on the iPhone AppStore graphic.

    I think the issue is this line in the HTML when one opens a link to an app:

    <body onload="detectAndOpenItunes();" class="software geo-us">

    Which probably points back to this script:

    <script type="text/javascript" charset="utf-8" src="http://ax.phobos.apple.com.edgesuite.net/htmlResources/D21A/web-storefront .jsz"></script>

    I could turn off JavaScript, but I really don't want to do that.

    After following the JavaScript, I think the answer is to redefine how itms:// is handled. I used More Internet <http://www.monkeyfood.com/software/MoreInternet/> to use Safari as the helper for itms and itmss and that seems to have stopped it, but now the View in iTunes link does work

    I need to figure out how to stop the onLoad from loading it for just that page type. I vaguely remember some program that lets the user rewrite JavaScript on the fly (Greasemonkey?), but that may only be for FireFox.

    Message was edited by: Allan Marcus1
  • Carolyn Samit Level 10 Level 10 (100,375 points)

    Thanks for posting the link.

    The link is posted on a non Apple website. You need to contact the site admin and report the bug to them. This is not a Safari tech issue.

  • Allan Marcus1 Level 1 Level 1 (45 points)
    No offense, but you are wrong. Any link, including those on Apple's site, that point to an app on the iTunes app store will open a web page and then, if using Safari, open the App Store. This is because of the itms:// link that the apple JavaScript feeds to Safari.

    See http://www.apple.com/iphone/apps-for-iphone/ and look at the page source after clicking on an app and getting the iTunes store preview. Download the script javascript from Apple. It's located at


    you will see, assuming you know JavaScript, that the page opens iTunes.
  • Fofer Level 1 Level 1 (135 points)
    Thanks for your work thus far on this.

    I investigated the same thing last week, down to using "More Internet" (to remove those itms and itmss helper protocols) but ended with the same results as you.

    Rest assured, many will be bugged by this behavior soon. Now that we have the interstitial App Store page appearing on the web, there's really no reason for iTunes to launch (unless we want it to, and can do so by clicking the "launch in iTunes" button.) I'm thinking we'll see some hacks or workarounds soon. Or hopefully Apple will hear some complaints, and make it an optional step. It works better in Firefox/Chrome, there's a popup dialog before it launches iTunes (which you can dismiss permanently by checking a box.)

    That said, now that you've identified the javascript that's causing it in Safari... we're off to a good start in "fixing" it. I will be sharing this link with others, hoping to find help.

    Also, just to put it out there, Greasemonkey scripts can indeed be used with Safari -- it's called Greasekit.

  • Fofer Level 1 Level 1 (135 points)
    Sure enough, here's a Greasemonkey script that deals with this issue. It halts the automatic loading of iTunes to the App Store, and lets the user click instead.


    Greasemonkey scripts work natively in the latest Chrome beta for Mac, and Safari by way of Greasekit:

  • jvo99 Level 1 Level 1 (0 points)
    <<*Rest assured, many will be bugged by this behavior soon*.>>

    I am part of the "many". This is annoying. If Micro$oft were doing this with IE (forcing users to their own store to buy stuff), we would all be screaming "Big Brother!", etc. And the fix available, having to run a third-party script to modify my browser's behavior (and then worry that it will break after the next OS update) is very un-Apple. What happened to caring about the user experience, Steve? We have been loyal to you, how about reciprocating? I know how to go to the App Store if I need to.

  • EmbeddedGeek Level 1 Level 1 (55 points)

    This is happening on windows, Mozilla, Internet exploder, Opera, ...

    This is functionally malware in itunes.

    Message was edited by: EmbeddedGeek