Skip to content

Instantly share code, notes, and snippets.

@tkdn
Last active October 22, 2022 00:26
Show Gist options
  • Save tkdn/fbbbc943da0e18a89a2cda3784e6d2f7 to your computer and use it in GitHub Desktop.
Save tkdn/fbbbc943da0e18a89a2cda3784e6d2f7 to your computer and use it in GitHub Desktop.
React Doc 英語版から日本語に移動するリンクを追加
// ==UserScript==
// @name 出、出~反応取説日本語版転送奴〜
// @namespace https://gist.github.com/tkdn/fbbbc943da0e18a89a2cda3784e6d2f7#file-react-doc-transfer-to-ja-user-js
// @updateURL https://gist.github.com/tkdn/fbbbc943da0e18a89a2cda3784e6d2f7/raw/6ee1f979f4f8dee68f2d367c5301934fb3abf2bc/react-doc-transfer-to-ja.user.js
// @downloadURL https://gist.github.com/tkdn/fbbbc943da0e18a89a2cda3784e6d2f7/raw/6ee1f979f4f8dee68f2d367c5301934fb3abf2bc/react-doc-transfer-to-ja.user.js
// @version 0.1
// @description React Doc 英語版から日本語に移動するリンクを追加
// @author tkdn <tkdnation@gmail.com>
// @match https://reactjs.org/*/*
// @grant none
// ==/UserScript==
(() => {
console.log('出、出~反応取説日本語版転送奴〜')
const { host, pathname } = new URL(location.href)
if (host !== 'reactjs.org') {
return
}
const link = document.createElement('a')
link.style.cssText = 'background-color: #333; color: #61dafb; position: fixed; height: 1.2em; bottom: .2em; left: .2em; padding: .1em;'
link.href = `https://ja.reactjs.org${pathname}`
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