Skip to content

Instantly share code, notes, and snippets.

@tkdn
Last active February 10, 2023 06:42
Show Gist options
  • Save tkdn/26f5beb115a29f05460d7406bd8fc158 to your computer and use it in GitHub Desktop.
Save tkdn/26f5beb115a29f05460d7406bd8fc158 to your computer and use it in GitHub Desktop.
出、出〜鉄道文書和訳輪付奴〜
// ==UserScript==
// @name 出、出〜鉄道文書和訳輪付奴〜
// @namespace https://gist.github.com/tkdn/26f5beb115a29f05460d7406bd8fc158#file-rails-doc-transfer-to-ja-user-js
// @updateURL https://gist.github.com/tkdn/26f5beb115a29f05460d7406bd8fc158/raw/0ca538e290d376f758dfb8ac4edae34bdfd059d7/rails-doc-transfer-to-ja.user.js
// @downloadURL https://gist.github.com/tkdn/26f5beb115a29f05460d7406bd8fc158/raw/0ca538e290d376f758dfb8ac4edae34bdfd059d7/rails-doc-transfer-to-ja.user.js
// @version 0.1
// @description Rails Doc 英語版から日本語に移動するリンクを追加
// @author tkdn <tkdnation@gmail.com>
// @grant none
// ==/UserScript==
(() => {
console.log('出、出〜鉄道文書和訳輪付奴〜')
const { host, pathname, hash } = new URL(location.href)
if (host !== 'guides.rubyonrails.org') {
return
}
const link = document.createElement('a')
link.style.cssText = 'background-color: #ff0a00; color: #61dafb; position: fixed; height: 1.2em; bottom: .2em; left: .2em; padding: .1em; font-weight: bold; font-size: 1.4em;'
link.href = `https://railsguides.jp/${pathname}${hash}`
link.innerHTML = 'to: Ja'
document.body.appendChild(link)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment