Skip to content

Instantly share code, notes, and snippets.

@hyuki
Last active January 15, 2019 02:57
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 hyuki/eec856e19db90ba80f54251e018b3059 to your computer and use it in GitHub Desktop.
Save hyuki/eec856e19db90ba80f54251e018b3059 to your computer and use it in GitHub Desktop.
ShowMobileTweet.js - Bookmarklet to jump from twitter.com to mobile.twitter.com.
/*
* ShowMobileTweet.js
*
* When you see:
* https://twitter.com/hyuki/status/1079981317184315392
* Then jump to:
* https://mobile.twitter.com/hyuki/status/1079981317184315392
*/
function start() {
var url = location.href;
if (url.match(/^https?:\/\/(mobile\.)?twitter\.com\/(.+)/)) {
var tail = RegExp.$2;
location = 'https://mobile.twitter.com/' + tail;
} else {
alert("Twitter URL is not found.\n" + url);
}
}
start();
@hyuki
Copy link
Author

hyuki commented Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment