Skip to content

Instantly share code, notes, and snippets.

@hyuki0000
Created May 12, 2017 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki0000/3186540cad7c71f6c67f0a0e73d11b6b to your computer and use it in GitHub Desktop.
Save hyuki0000/3186540cad7c71f6c67f0a0e73d11b6b to your computer and use it in GitHub Desktop.
RemoteFollowBookmarklet.js - Jump to the mastodon user's remote_follow page.
/*
* RemoteFollowBookmarklet.js
*
* When you see
* https://mastodon.example.com/@exampleuser
* or
* https://mastodon.example.com/users/exampleuser/...
* Then you jump to
* https://mastodon.example.com/users/exampleuser/remote_follow
*/
function start() {
if (location.href.match(/(https?:\/\/.*)\/@(.+)/) || location.href.match(/(https?:\/\/.*)\/users\/([^/]+)/)) {
var prefix = RegExp.$1;
var username = RegExp.$2;
location = prefix + '/users/' + username + '/remote_follow';
} else {
alert("Error.");
}
}
start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment