iTunes 9, now with more WebKit

As John Gruber predicted yesterday, iTunes 9 certainly uses WebKit much more than the last version. I used wireshark to do a packet trace when I clicked on the Rock Music section. Sure enough, if you gunzip the response, it is effectively standard HTML (though they do declare a custom XML namespace for everything). It looks like this new HTML based format is triggered by the request header:

X-Apple-Store-Front: 143441-1,5

For example, the following simple curl command will retrieve this Rock page:

curl -H "X-Apple-Store-Front: 143441-1,5" \
    http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewGrouping?id=24

To further verify that iTunes was doing little more than rendering the result with WebKit, I went through the response HTML, fixed a couple of URLs, and got this result – exactly what you see in iTunes 9. Of course, the “Quick View” for each album doesn’t work, but you can see how it is all pieced together.

Comments and responses

Have you written a response to this? Let me know the URL:

Adding <base href="http://ax.itunes.apple.com"> inside <head> is a quick one-shot way to deal with relative URLs while working with a local copy of the file.
Agree with Jason Painter... hoping this unlocks some way to retrieve TV and Movie art again.

Yeah still a crummy old carbon app & talk about bloat.. the installed iTunes 9 app on Snow Leopard is 151Mb. After 'slimming' with Xslimmer it is now 32.8Mb

Thats 118Mb of HDD space sucking garbage removed with ONE app alone..

I noticed that, on my 10.5, non-iPhone-developing machine, the iTunes 9 installer required that I quit Xcode. I don't recall that happening before.

this whole webkit rendering makes my itunes really slow - on my 2009 imac. feels like playing a high end video game on a low end pc.

apple should improve the performance :(

regards, jrk fluxforge.com

If you use GlimmerBlocker, and add the following rule, you can browse the iTunes store in Safari:

<?xml version="1.0" encoding="UTF-8"?>
<glimmerblocker-rules>
    <rule rule-id="272656319" priority="2" type="request" host="ax.itunes.apple.com" host-type="is">
        <request language="js" version="1"><![CDATA[var ua = gb.request.headers['User-Agent'];
ua = ua ? ua.toString() : "none";
if (ua.match(/Safari/) && !gb.request.headers['X-Apple-Store-Front'])
    gb.request.headers['X-Apple-Store-Front'] = '143441-1,5';]]></request>
    </rule>
</glimmerblocker-rules>

Copy the xml, and paste it into the rules table in your own filter.

[...] Will Norris has discovered that iTunes 9’s interactions with the Store are more web-happy. I’ve been asking where the iTunes Store API was for some time, now I think I’ve got what I need to build one. Others also read: Related:Do We Need A WordPress Common Invite or Challenge-Response API?stand alone AppleTV?EMI and Apple/iTunes To Offer DRM-Free Music DownloadsiTunes Music Store API?Do Facebook Ads Work? [...]

Was wondering if you would be able to post more details on how to go about retrieving the HTML? I have never tried anything like this and want to copy the content from an Album page as proof of concept for my honours project.

Also, any thoughts if it is possible to:

  • add menu items to iTunes, ie your own custom devices?
  • surf external web pages within itunes? (ie itunes.exe -u "google.com")?

I would like to build a java swing application that will have a embedded web-browser, and I want to prevent the users to see the HTML content or to have direct access to my URLs.

I was thinks to do something similar to ITunes until now (MVC framework on server side and encrypt data to send back to client side).

Do you recommend me some other approach? There´s a secure way to do this?

Thanks.