Google翻訳
by
shiiiiir
2017-04-11 [2017/04/11 15:33:36]
範囲選択した箇所をGoogle翻訳ページで表示。範囲選択してなければ現在のURLをページごと翻訳、もしくはGoogle翻訳ページを開く
/*
* @title Google翻訳
* @description 範囲選択した箇所をGoogle翻訳ページで表示。範囲選択してなければ現在のURLをページごと翻訳、もしくはGoogle翻訳ページを開く
* @include http://*
* @license MIT License
* @javascript_url
*/
(function (s, e, g) {
window.open(s.length > 0 ? g + '/#auto/ja/' + e(s) : confirm('translate this page?') ? g + '/translate?hl=ja&sl=auto&tl=ja&u=' + e(location.href) : g, '_blank');
}) (document.getSelection().toString(), encodeURIComponent, '//translate.google.com');
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。