-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
只能用搜狗翻译切换其他翻译失效 #35
Comments
可以自己修,utility文件夹下 class Deepl_web_cd extends Web_cd
{
__New()
{
url := 'https://www.deepl.com/zh/translator'
input_js :='
(
{
const editor = document.querySelector("d-textarea[name=\"source\"]");
const inputbox = document.querySelector("d-textarea[name=\"source\"] > div");
inputbox.textContent = "{1}";
setTimeout(() => {
editor.dispatchEvent(new InputEvent("input"));
}, 20);
}
)'
out_put_js := '
(
{
o = document.querySelector('d-textarea[name=\"target\"]')
function callback3(records) {
records.forEach(function(record) {
try
{
//aa = o.querySelector('[class="ordinary-output target-output clearfix"]');
console.log(o.textContent);
obj = window.chrome.webview.hostObjects.ahk;
obj.func(o.textContent);
}
catch
{
try
{
console.log('');
obj = window.chrome.webview.hostObjects.ahk;
obj.func('');
}
catch
{
}
}
})
}
var ob3 = new MutationObserver(callback3)
ob3.observe(o, {
characterDataOldValue: true,
attributes: true,
childList: true,
characterData: true,
subtree: true
})
}
)'
super.__New(url, input_js, out_put_js,, 'deepl')
}
__Delete()
{
}
} |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
搜狗翻译正常,
其他翻译无法使用。
启动方式网页版
The text was updated successfully, but these errors were encountered: