Skip to content

Instantly share code, notes, and snippets.

@Raureif
Last active October 15, 2015 22:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raureif/11169787 to your computer and use it in GitHub Desktop.
Save Raureif/11169787 to your computer and use it in GitHub Desktop.
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.');}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment