Skip to content

Instantly share code, notes, and snippets.

@Raureif
Raureif / dasReferenz-bookmarklet
Last active October 15, 2015 22:43
Das Referenz: Bookmarklet for iOS Safari to open current Wikipedia article in the Das Referenz app. More Info: http://dasReferenz.com
javascript:(function(){var hostnameComponents = (window.location.hostname).split('.');var pathnameComponents = (window.location.pathname).split('/');if (hostnameComponents[1] == "m") {var lang = hostnameComponents[0];var domain = hostnameComponents[2];var article = pathnameComponents[2];} else {var lang = hostnameComponents[0];var domain = hostnameComponents[1];var article = pathnameComponents[2];}if (lang !== '' && article !== '' && domain === 'wikipedia') {window.open('dasReferenz://' + lang + '/' + article);} else {alert ('This does not seem to be a Wikipedia page you\'re currently looking at.');}})();