Sharing and backing up on pdf my custom grease monkey java scripts. This one for translation of japanese and korean, with fast keyboard commands using alt key for english learners: England Canada USA And Australia I made in bedroom at home on spare time. Anyone can share, post it or reuse it sourcecode sharing here ENJOY! ~Alexander ~Italy
// ==UserScript==
// @name
[Hack] Korean/Japan Translate Alt+'x,c,v,g,q,a,w,s,b'
// @namespace ViolentMonkeyBeta
// @version
4.9
// @description Kor Dict 'Alt+x' Kor Trans 'Alt+c' Japan Dict Alt+v' Japan Trans 'Alt+g' _ Software Kor 'Alt+q' Software Jap 'Alt+w'
DuckDuckGo: Kor 'Alt+a' Jap 'Alt+s' Offline Software, search:??? 'Alt+b'
// @descrip.Cont Software Kor 'Alt+q' Software Jap 'Alt+w' DuckDuckGo: Kor 'Alt+a' Jap 'Alt+s' Offline Software, search:??? 'Alt+b'
// @author
// @match
// @grant
MegzumiSazuki
*://*/*
none
// @license MIT
// ##downloadURL
// ##updateURL
// ==/UserScript==
(function() {
'use strict';
document.addEventListener('keydown', function(event) {
/*
/*
console.log(`Key pressed: ${event.key}, Ctrl: ${event.ctrlKey}, Alt: ${event.altKey}`); */
var selection = window.getSelection().toString();
if (event.altKey && event.key.toLowerCase() === 'x' && !event.shiftKey && !event.ctrlKey) {
console.log(`Selection for search: ${selection}`); */
if (selection) {
window.open('https://duckduckgo.com/?t=h_&q=korean+online+free+dictionary+' + encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 'c' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for translation: ${selection}`); */
if (selection) {
window.open('https://translate.yandex.com/en/?source_lang=en&target_lang=ko&text=' +
encodeURIComponent(selection) + '&op=translate');
}
}
if (event.shiftKey && event.altKey && event.key.toLowerCase() === 'c' && !event.ctrlKey) {
/*
console.log(`Selection for translation: ${selection}`); */
if (selection) {
window.open('https://translate.yandex.com/en/?source_lang=en&target_lang=ko&text=' +
encodeURIComponent(selection) + '&op=translate');
}
}
if (event.altKey && event.key.toLowerCase() === 'v' && !event.shiftKey && !event.ctrlKey) {
/*
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
window.open('https://duckduckgo.com/?t=h_&q=japanese+online+free+dictionary+' + encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 'g' && !event.shiftKey && !event.ctrlKey) {
console.log(`Selection for translation: ${selection}`); */
if (selection) {
window.open('https://translate.yandex.com/en/?source_lang=en&target_lang=ja&text=' +
encodeURIComponent(selection) + '&op=translate');
}
}
if (event.shiftKey && event.altKey && event.key.toLowerCase() === 'g' && !event.ctrlKey) {
/*
console.log(`Selection for translation: ${selection}`); */
if (selection) {
window.open('https://translate.yandex.com/en/?source_lang=en&target_lang=ja&text=' +
encodeURIComponent(selection) + '&op=translate');
}
}
if (event.altKey && event.key.toLowerCase() === 'w' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
let y = window.location.href.replace &&
window.open('https://duckduckgo.com/?q=(LibreTra)_(lingva%3Ajapan%3B%22dictionary%22%2C%22PC%22%2C%22software%
22:' + encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 'q' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
let y = window.location.href.replace &&
window.open('https://duckduckgo.com/?q=(LibreTra)_(lingva%3Ayandex%3Akorea%3B%22dictionary%22%2C%22PC%22%2C%2
2software%22:' + encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 'a' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
let y = window.location.href.replace && window.open('https://duckduckgo.com/?q=korean%3B%22' +
encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 's' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
let y = window.location.href.replace && window.open('https://duckduckgo.com/?q=japanese%3B%22' +
encodeURIComponent(selection));
}
}
if (event.altKey && event.key.toLowerCase() === 'b' && !event.shiftKey && !event.ctrlKey) {
/*
console.log(`Selection for search: ${selection}`); */
if (selection) {
let y = window.location.href.replace && window.open('https://duckduckgo.com/?q=%22free%22(offline
dictionary)%7Dpc%3D%22:' + encodeURIComponent(selection));
}
}
});
})();
Javascript name for vilentmonkey
Greasemonkey addons.
[Hack] Korean/Japan Translate
Alt+'x,c,v,g,q,a,w,s,b'
Settings? Use below.
In addon options.
Allow update and notify?: “Off” “No”
Icon:
https://archive.vn/6hdrW/bbf3a651382378e1100bc6
7cd7a09a40d4b9e957.jpp
#japan #korea #japanese #korean #keyboard #computer #greasemonkey #vientmonkey #edu #learning #computer #linux #mac #windows #webbrowseraddon #addon #extension