Prevent iTunes websites from opening the iTunes app using GlimmerBlocker
A few minutes ago I clicked on an iTunes store link on a website and had to again completely lose it because of the iTunes app popping up without me asking it to. This is a common annoyance that people have found a bunch of different ways to combat, ranging from messing with the system's (or the browser's) mapping of URL protocol handlers to rewriting parts of web pages via a browser plugin (e.g. GreaseMonkey) or a localhost web proxy (e.g. GlimmerBlocker).
I read somewhere that Safari (or the OS? or iTunes?) sometimes decides to "fix" the mappings of iTunes URL protocol handlers, forcing you to "play cat and mouse" if you decide to prevent iTunes from automagically opening up by removing it as the itms: protocol handler, so I decided that it would be best to try and fix this problem by messing with the iTunes website source via GlimmerBlocker, which I already was using for ad blocking.
I couldn't find any straightforward directions on how to do this with GlimmerBlocker so I decided to post it here myself once I figured out how to do it. So this is how I prevented iTunes from automatically opening up whenever I open up a store link in my browser:
- Open the GlimmerBlocker "filters" tab and add a new filter, as well as a new rule for this filter.
- Select Whitelist URL, optionally modifying content as the action
- For the Host section, select is as the predicate and type in itunes.apple.com
- Select ignored for both Path and Query
- Switch to the transform tab and type in the following:
- Make sure the Only for content-type selection in the bottom-right corner of the dialog sheet is html
- Save
replace(/detectAndOpenItunes\(\);/g, "<!-- detectAndOpenItunes() zapped -->");
This seems to correctly prevent the iTunes app from opening up whenever a store website is opened, but it still allows for opening the viewed product in the stand-alone app via the "View in iTunes" link on the page.
3 Comments
[…] Post in English via hasseg.org/. […]
This works great, thanks a lot :)
[…] Post in English via hasseg.org/. […]