Tags
Twitter Updates
- the Scratch My Back iTunes LP has reached the #1 spot in Germany. Have a sneak peak - http://bit.ly/alWwAb 3 weeks ago
- just drinking some tea. about to code (apparently people on twitter are interested in this kinda thing) 1 month ago
- Just what we need, another blog to clutter up those Internet tubes: pixelbyter.com 1 month ago
-
Recent Posts
-
Recent Comments
-
RSS
Blogroll
iTunes LP/Extras Javascript redirects
For iTunes LP and iTunes Extras content programatically loading a link is very difficult. Both iTunes and AppleTV don’t support the Javascript function windows.open() or the property window.location. I’ve managed to come up with this bypass (aka hack) which is demonstrated in the Javascript code below. It triggers a mouse click event emulating the user manually clicking a link on the page.
//click a link with id 'my_link' clickLink(document.getElementById('my_link')); function clickLink(elementId) { var elm = document.getElementById(elementId); //set up mouse click event var evt = document.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); //trigger click event on html element elm.dispatchEvent(evt); }