插件:强制谷歌翻译以翻译注入的文本
我是一个业余程序员,最近我发现了如何为Google Chrome制作插件。 我正在使用Google翻译大量翻译在英语荷兰语和阿拉伯语之间。 现在,我正在尝试为Google Translate网站制作插件,以便根据字段IM键入的字段自动将输入字符更改为正确的字符。 (无法更改键盘布局) 长话短说:我设法将字符更改为正确的字符,但是Google翻译不会翻译文本,除非我按Enter或其他我没有更改的键。
代码有点混乱,没有添加整个内容。基本上,我使用了按键和键盘功能将正确的字符注入文本字段中。
Im an amateur programmer, and recently i discovered how to make plugins for google chrome.
Im using google translate alot to translate between english dutch and arabic.
Now im trying to make a plugin for the google translate website so it will automaticly change the input characters to the correct ones depending on the field im typing in.
(changing keyboard layout is not possible)
Long story short: I managed to change the characters to the correct ones, but google translate doesn not translate the text, unless i press enter or another key that i didnt change.
the code is a bit messy not gone add the whole thing. basicly i used the keypressed and keydown functions to inject the correct characters in the textfield.
What code can i use to force google translate to translate the text?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关键是要将
气泡
event()
构造函数的第二个参数对象的属性更改为true> True
(默认值为false )。
The key is to change the
bubbles
property of the second parameter object of theEvent()
constructor totrue
(the default value isfalse
).