This is an intervention. Detox is a tiny Safari extension that automatically expands shortened t.co links on the Twitter site (third-party desktop app users
are out of luck, sorry should see the 1.1 update below).
Location header) so that Twitter can stake itself out as the referrer when coming from third-party clients. This confuses Safari.
Stats are cool and all but only when they don’t break the experience for your users.
Now when you hit a t.co redirect page (from a native client or a direct message from Mail.app) the destination url is added to the document title making the destination url appear in your history and url autocomplete suggestions.
Recently Twitter updated their link expansion
data attributes. Previously the expanded url could be found in each link’s
data-expanded-url attribute. A recent update duplicates the t.co url in
data-expanded-url and puts the true url in
Digging deeper it appears that
data-ultimate-url contains the terminal for twice (or more) shortened urls (eg. a t.co’d bit.ly pointing to the terminal google.com). Detox 1.2.2 Uses
data-ultimate-url if available, falling back on the original
data-expanded-url containing the t.co instead of the expanded url may have just been a temporary Twitter bug. I regret jumping to conclusions but with twice shortened urls the user never sees the intermediate url which is what ultimately lead to the confusion.
Updated to address changes in Google’s markup. No longer relies on a class name so it should be more future proof.
Google (relatively?) recently made a change to their image search results markup. This update removes code that broke inline image preview as a result of this change.