Translator

Press (F2) to Translate.

Устаревшая версия на 21.10.2019. Перейти к последней версии.

// ==UserScript==
// @version     4.0.1.4
// @name        Translator
// @name:de     Übersetzer
// @namespace   wack.3gp
// @description Press (F2) to Translate.
// @description:de Drücken Sie (F2) zum übersetzen.
// @include     *://*
// @author  wack.3gp
// @copyright   2019+ , wack.3gp
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_notification
// @supportURL https://greasyfork.org/scripts/4610/feedback
// @license Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License; http://creativecommons.org/licenses/by-nc-nd/3.0/
// ==/UserScript==

// ==VAR==
var jslink = "javascript";
// ==============

// ==Function==
    unsafeWindow.translate = function(){
        window.location="http://translate.google.com/translate?sl=auto&u="+window.location;
        };
// ==============

// ==Key==
document.onkeydown= openPage ;
function openPage(e) {
e= window.event ? event : e;
    if (e.keyCode == 113 ) {location.href=jslink+":translate()";}
}
// ==============