Wednesday, March 17, 2010

How-To: Stop iTunes Web Links From Opening iTunes

How-To: Stop iTunes Web Links From Opening iTunes: "


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


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.





"

0 Comments:

Post a Comment

<< Home