Skip to content

Instantly share code, notes, and snippets.

@hyuki

hyuki/ShowMobileTweet.js

Last active Jan 15, 2019
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@hyuki hyuki commented Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.