Skip to content

Instantly share code, notes, and snippets.

@pocke
Created December 6, 2014 01:49
Show Gist options
  • Save pocke/eb1bd0d7644cb32d4cef to your computer and use it in GitHub Desktop.
Save pocke/eb1bd0d7644cb32d4cef to your computer and use it in GitHub Desktop.
(function () {
var url = window.location.href;
var regexp = /docs\.ruby-lang\.org\/ja\/([0-9.]+)/;
var latest_version = '2.1.0';
if (url.match(regexp) && RegExp.$1 != latest_version) {
var new_url= url.replace(RegExp.$1, latest_version);
window.location.href = new_url;
}
})();
@pocke
Copy link
Author

pocke commented Dec 6, 2014

javascript:(function(){(function%20()%20{var%20url%20=%20window.location.href;var%20regexp%20=%20/docs\.ruby-lang\.org\/ja\/([0-9.]+)/;var%20latest_version%20=%20'2.1.0';if%20(url.match(regexp)%20&&%20RegExp.$1%20!=%20latest_version)%20{var%20new_url=%20url.replace(RegExp.$1,%20latest_version);window.location.href%20=%20new_url;}})();})();

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