Translator

Press (F2) to Translate.

目前为 2022-07-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @version 4.0.4.1
  3. // @name Translator
  4. // @name:de Übersetzer
  5. // @description Press (F2) to Translate.
  6. // @description:de Drücken Sie (F2) zum übersetzen.
  7. // @author JAS1998
  8. // @copyright 2019+ , JAS1998 (https://gf.qytechs.cn/users/4792)
  9. // @namespace https://gf.qytechs.cn/users/4792
  10. // @icon https://translate.google.com/favicon.ico
  11. // @supportURL https://gf.qytechs.cn/scripts/4610/feedback
  12. // @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
  13. // @noframes
  14. // @compatible Chrome tested with Tampermonkey
  15. // @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
  16. // @contributionAmount €1.00
  17. // @resource meta https://gf.qytechs.cn/scripts/4610/code/meta.js
  18. // @grant GM_notification
  19. // @grant GM_getResourceText
  20. // @match *://*/*
  21. // @exclude /^[a-z]{4}.*\/greasyfork\.org\/.*\/4610.*$
  22. // ==/UserScript==
  23.  
  24. /* jshint esversion: 9 */
  25.  
  26. document.onkeydown = openPage;
  27.  
  28. function openPage(F2) {
  29. if (GM_info.script.copyright.includes(GM_info.script.namespace)) {
  30. F2 = window.event ? event : F2;
  31. if (F2.keyCode == 113) {
  32. if (GM_getResourceText("meta").indexOf(GM_info.script.version) > -1) {
  33. location.href = "http://translate.google.com/translate?sl=auto&u=" + window.location;
  34. GM_notification({
  35. title: GM_info.script.name,
  36. text: "Post a review, comment, or question",
  37. timeout: "10000",
  38. onclick: function () {
  39. location.href = GM_info.script.supportURL;
  40. },
  41. });
  42. }
  43. else {
  44. console.warn("Please download " + GM_getResourceText("meta").replace(/.*(?=v.*\d\D\d\D\d\D\d)/gims, '').split('/')[0] + GM_info.script.supportURL.replace("feedback", ""));
  45. GM_notification({
  46. title: "Update!",
  47. text: "Please download " + GM_getResourceText("meta").replace(/.*(?=v.*\d\D\d\D\d\D\d)/gims, '').split('/')[0],
  48. onclick: function () {
  49. location.href = GM_info.script.supportURL.replace("feedback", "");
  50. },
  51. });
  52. }
  53. }
  54. }
  55. else {
  56. location.href = GM_info.script.supportURL.replace("feedback", "");
  57. alert("Please install the Orginal Version");
  58. }
  59. }
  60.  
  61. if (window.location.host.includes('translate.google')) {
  62. console.log("Post a review, comment, or question\n" + GM_info.script.supportURL + "\n\nCopyright " + GM_info.script.copyright);
  63. }
  64. // ==============

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址