# 向 Anki 添加 Goldendict 快速查词链接

**URL:** <https://forum.freemdict.com/t/topic/18052>\
**Category:** 软件经验交流展望\
**Tags:** goldendict, anki\
**Created:** [2022 年12 月 21 日 00:33 UTC](https://forum.freemdict.com/t/topic/18052 "2022-12-21T00:33:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![slbtty](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/slbtty/32/19175_2.png) [@slbtty](https://forum.freemdict.com/u/slbtty)\
**Post date:** [2022 年12 月 21 日 00:33 UTC](https://forum.freemdict.com/t/topic/18052/1 "2022-12-21T00:33:49Z")

</div>

xiaoyifang/goldendict 的最新版本在 Linux/Windows 上有一个新功能，就是可以在支持超链接的地方使用 `goldendict://word` 来快速打开 goldendict 查询单词，比如说可以在 word 里面放这样的链接：

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/3/d/3dca6fdc8c84b5fccc430e7a727dc30316d9c0e4.png)

> <https://github.com/xiaoyifang/goldendict/issues/221>
>
> \- 为什么会有这种问题？
> - 我不清楚xiaoyifang大大有没有用过\[Obsidian\](https://obsidian.md/)，这是一款非常牛逼…的笔记软件，其中有个功能叫做\[Obsidian URI\](https://help.obsidian.md/Advanced+topics/Using+obsidian+URI)，就是支持一种\`obsidian://.......\`格式的链接，你在电脑上任意位置点击这个链接就可以打开Obsidian并且自动定位到你在链接中指定的笔记位置。熟练使用的话可以玩出花来，比如使用这种链接与Anki联动，复习的时候随时跳转到笔记的出处以复习上下文
> !\[image\](https://user-images.githubusercontent.com/66851780/203542106-e3050ee1-c50e-4fbd-9378-3bb40b465a86.png)
> - 隔壁欧陆词典也有这种玩法，链接语法相同\`eudic://.......\`，同样可以镶嵌到各种你想得到的地方，比如镶嵌到anki的模板里
> \`\`\` html
> \<a onclick="event.stopPropagation();" href="eudic://x-callback-url/searchword?word={{text:Word}}&x-success=anki://"\>
> \<img class="icon" src="\_goldendict.png"\>\</a\>
> \`\`\`
> \- 所以gd有没有这种链接？
> \---
> \- 如果是GD的这种链接，不妨点击之后产生和ctrl+c+c一样的效果，也就是弹出悬浮窗

在 Anki 里面添加查词链接只要稍微改一下模板就可以了

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/6/b/6bfdcf85c28e4823f081ac13362cba01355af9bf.png)

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/9/c/9c5059b5b2ecdf9857c4ab006d61bc4996688ff2.png)

把原来的 `{{Front}}` 用 `<a>` 包裹一下就可以了

```html
<a href="goldendict://{{Front}}">{{Front}}</a>

```

然后 Anki 里面的词就变成点击即从 Goldendict 查询。

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/b/8/b849cafbf1e9fa332329b655f3b4de520091d62e.png)

这样就完全不需要往 Anki 卡片里面添加具体内容，只放一个词头就行了。

---

<div class="post-metadata">

**Author:** ![mdict6](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mdict6](https://forum.freemdict.com/u/mdict6)\
**Post date:** [2022 年12 月 21 日 01:30 UTC](https://forum.freemdict.com/t/topic/18052/2 "2022-12-21T01:30:40Z")

</div>

虽然小众，不失为一种提高效率的方法  
赞一个

---

<div class="post-metadata">

**Author:** ![风僧白云剑](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/%E9%A3%8E%E5%83%A7%E7%99%BD%E4%BA%91%E5%89%91/32/3440_2.png) [@风僧白云剑](https://forum.freemdict.com/u/%E9%A3%8E%E5%83%A7%E7%99%BD%E4%BA%91%E5%89%91)\
**Post date:** [2022 年12 月 21 日 13:30 UTC](https://forum.freemdict.com/t/topic/18052/3 "2022-12-21T13:30:38Z")

</div>

很有用，早就想这种用法了

---

<div class="post-metadata">

**Author:** ![PilgrimLyieu](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@PilgrimLyieu](https://forum.freemdict.com/u/PilgrimLyieu)\
**Post date:** [2023 年2 月 19 日 03:31 UTC](https://forum.freemdict.com/t/topic/18052/4 "2023-02-19T03:31:42Z")

</div>

请问一下如果我想要在移动端（AnkiDroid）使用 `eudic://dict/word`，在桌面端（Anki）使用 `goldendict://word`，我该怎么做呢？非常感谢！

---

<div class="post-metadata">

**Author:** ![slbtty](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/slbtty/32/19175_2.png) [@slbtty](https://forum.freemdict.com/u/slbtty)\
**Post date:** [2023 年2 月 19 日 10:36 UTC](https://forum.freemdict.com/t/topic/18052/5 "2023-02-19T10:36:18Z")

</div>

判断一下在 android 上然后选择性隐藏就可以 @PilgrimLyieu

 ![Screen Shot 2023-02-19 at 5.32.15 AM](https://forumcdn.freemdict.com/uploads/default/original/3X/8/8/88c3b4cd3f7240500180be957b477e1a60f87811.png)

```javascript
<script>
if( navigator.userAgent.match(/(android)/i) ){
 	document.getElementById("desktop").style.display="none"
} else {
	document.getElementById("mobile").style.display="none"
}
</script>
<a id="desktop">{{Front}}</a>
<a id="mobile">{{Front}}</a>

```

不清楚 ankidroid 是怎么设置 userAgent 的，不过我觉得应该会包含 `android`

---

<div class="post-metadata">

**Author:** ![PilgrimLyieu](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@PilgrimLyieu](https://forum.freemdict.com/u/PilgrimLyieu)\
**Post date:** [2023 年2 月 20 日 04:34 UTC](https://forum.freemdict.com/t/topic/18052/6 "2023-02-20T04:34:08Z")

</div>

非常感谢您！

---

<div class="post-metadata">

**Author:** ![双人木马](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/%E5%8F%8C%E4%BA%BA%E6%9C%A8%E9%A9%AC/32/44515_2.png) [@双人木马](https://forum.freemdict.com/u/%E5%8F%8C%E4%BA%BA%E6%9C%A8%E9%A9%AC)\
**Post date:** [2023 年3 月 14 日 12:18 UTC](https://forum.freemdict.com/t/topic/18052/7 "2023-03-14T12:18:40Z")

</div>

非常感谢！想请问下为什么我的安卓手机上会两个都显示出来呢？

 ![Screenshot_2023-03-14-20-07-15-315_com.ichi2.anki](https://forumcdn.freemdict.com/uploads/default/original/3X/a/4/a44fb1e1ead5dcd50df496ee927b1dfbd9bdd078.jpeg)  
 ![64554b811a63e0aa](https://forumcdn.freemdict.com/uploads/default/original/3X/3/6/367edb14e8cec61728dde633a049dd5d04a3172d.png)

---

<div class="post-metadata">

**Author:** ![PilgrimLyieu](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@PilgrimLyieu](https://forum.freemdict.com/u/PilgrimLyieu)\
**Post date:** [2023 年12 月 18 日 12:54 UTC](https://forum.freemdict.com/t/topic/18052/8 "2023-12-18T12:54:28Z")

</div>

似乎无法查短语？

```html
<a href="goldendict://a link">link</a>

```

抑或是

```html
<a href="goldendict://a%20link">link</a>

```

在 Anki 都无法生效。Word 和 Edge 都会自动转为 `%20` 并打开 GoldenDict，但 Anki 似乎不行？

而 Android 上的欧陆词典则可以。

---

<div class="post-metadata">

**Author:** ![阿洛洛洛](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/%E9%98%BF/4bbf92/32.png) [@阿洛洛洛](https://forum.freemdict.com/u/%E9%98%BF%E6%B4%9B%E6%B4%9B%E6%B4%9B)\
**Post date:** [2024 年4 月 4 日 08:37 UTC](https://forum.freemdict.com/t/topic/18052/9 "2024-04-04T08:37:37Z")

</div>

非常感谢您的分享。  
但是我在使用这个方法的过程中遇到了一些困难，我目前正在学习法语，发现在出现诸如à,ç,û等法语特有字母时，跳转到字典软件会出现乱码，例如brûer会乱码成xn–brer-wra,这样一来就完全没办法使用这个功能呢？  
因为我完全不懂得编程，所以只得来求助了

---

<div class="post-metadata">

**Author:** ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
**Post date:** [2024 年6 月 28 日 00:41 UTC](https://forum.freemdict.com/t/topic/18052/10 "2024-06-28T00:41:49Z")

</div>

> [@阿洛洛洛](#):
>
> 例如brûer会乱码成xn–brer-wra

> <https://github.com/xiaoyifang/goldendict-ng/issues/1267>
>
> \> I asked about this feature yesterday because I could not get it working and th…e comment was deleted after I discovered that I had foolishly used the old generation GoldenDict to test it. Sorry about that. But now I have encountered a real problem.
> 
> \> Let me re-introduce some background information first. \[Diogenes\](https://github.com/pjheslin/diogenes) is a popular tool to browse classical texts, and users have been crying for GoldenDict integration for years. I am trying to add that feature by creating a link like \`\<a href="goldendict://$word"\>GoldenDict\</a\>\`. But both Firefox and Chrome URI-encode the href, turning \`goldendict://οὐετερανός\` into \`goldendict://%CE%BF%E1%BD%90%CE%B5%CF%84%CE%B5%CF%81%CE%B1%CE%BD%CF%8C%CF%82\`. GoldenDict seems unable to handle such URLs and the search term is decoded as \`CE�ὐετερανός\` (notice that only the first letter is not properly decoded). Am I doing it in the wrong way? Or is it a real issue and I should open one instead? By the way, \`xdg-open goldendict://οὐετερανός\` works very well.
> 
> Anyway, thanks for this extremely useful feature!
> 
> \_Originally posted by @Crissium in https://github.com/xiaoyifang/goldendict-ng/issues/227#issuecomment-1789883557\_

处理了

---

<div class="post-metadata">

**Author:** ![woodcube](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/woodcube/32/68865_2.png) [@woodcube](https://forum.freemdict.com/u/woodcube)\
**Post date:** [2024 年12 月 25 日 05:48 UTC](https://forum.freemdict.com/t/topic/18052/11 "2024-12-25T05:48:06Z")

</div>

作者您好，我在html文档里面、epub电子书里面写入`goldendict://(要查的词)`这样的链接后，点击链接：

如果此时goldendict已经最小化到托盘，goldendict可以获取焦点弹出查词页面；

但是如果此时goldendict页面已经打开，goldendict可以查词，但是没法获取焦点，无法弹出页面到最顶层。并且任务栏会出现下图所示的情况。

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/4/8/488c318a9790a68dd8f4333430f38f59797d1999.png)

请问有什么解决方法吗？从我个人使用习惯出发，比较需要点击连接后goldendict能直接弹出页面到最顶层。

操作系统：Windows10  
版本信息（复制自软件内部）：

```auto
Goldendict-ng 24.09.0.316ec900 at 2024-09-15T14:12:20Z
Qt 6.6.3 Visual C++ Compiler 194134120 windows winnt 10.0.19045 x86_64-little_endian-llp64
Flags: MAKE_ZIM_SUPPORT MAKE_CHINESE_CONVERSION_SUPPORT NO_TTS_SUPPORT no_ffmpeg_player

```

祝您生活愉快！

---

<div class="post-metadata">

**Author:** ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
**Post date:** [2024 年12 月 25 日 05:52 UTC](https://forum.freemdict.com/t/topic/18052/12 "2024-12-25T05:52:15Z")

</div>

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/d/e/ded29052a5a4bdffddeb9563d9a46265e83a2292.png)

试下这个选项

---

<div class="post-metadata">

**Author:** ![woodcube](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/woodcube/32/68865_2.png) [@woodcube](https://forum.freemdict.com/u/woodcube)\
**Post date:** [2024 年12 月 25 日 06:27 UTC](https://forum.freemdict.com/t/topic/18052/13 "2024-12-25T06:27:52Z")

</div>

作者您好，我打开了这个选项试了一下，发现只有goldendict在最大化窗口时，才能自动获取焦点。

但是我平时使用的时候是把goldendict窗口宽度调整到50%左右，然后紧贴右侧（这样看完解释后直接用鼠标点击使焦点回到原来阅读的部分），如下图所示。

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/0/1/0102d06166f8125b97b21526162a487443be50e6.png)

这个时候依然是虽可以进行查词，但是窗口不会跳到最顶层。

如果暂时无法通过设置解决的话，可以的话希望您能在下一个版本优化一下，谢谢！

感谢您的回复！

---

<div class="post-metadata">

**Author:** ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
**Post date:** [2024 年12 月 26 日 00:31 UTC](https://forum.freemdict.com/t/topic/18052/14 "2024-12-26T00:31:32Z")

</div>

后续看下，  
另外问下，这种方式下，你是怎么查词的？快捷键吗

---

<div class="post-metadata">

**Author:** ![woodcube](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/woodcube/32/68865_2.png) [@woodcube](https://forum.freemdict.com/u/woodcube)\
**Post date:** [2024 年12 月 26 日 15:51 UTC](https://forum.freemdict.com/t/topic/18052/15 "2024-12-26T15:51:28Z")

</div>

我目前在用这个quicker的一个动作：  
[GoldenDict 查词 - by 我也是小黑 - 动作信息 - Quicker](https://getquicker.net/Sharedaction?code=da22d100-e14e-4725-66b4-08d7e4bc3de9)

点进去有视频介绍操作，也是GoldenDict窗口不全屏，跟我的使用场景是一样的；

划词以后使用quicker动作快捷查词，这个quicker动作也就是模拟了复制、聚焦、粘贴、回车的按键（也是用到GoldenDict 的快捷键来弹出到最顶层）；

quicker里面还支持激活某个进程，但是我这里总是会把一个标题叫qt什么的窗口激活出来，关掉之后GoldenDict 也一起没了，所以就只让quicker模拟快捷键弹出来。

是长这样的：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/1/2/1261ac1b3fbca5982ecaa1aa89746e433b58ffb2.png)

---

<div class="post-metadata">

**Author:** ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
**Post date:** [2024 年12 月 28 日 09:48 UTC](https://forum.freemdict.com/t/topic/18052/17 "2024-12-28T09:48:07Z")

</div>

Windows的机制

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/d/7/d7e529140448cb625ae82f8bfe7a3d9a614afafb.png)  
[https://wiki.qt.io/Technical\_FAQ#QWidget\_::activateWindow.28.29\_-\_behavior\_under\_windows](https://wiki.qt.io/Technical_FAQ#QWidget_::activateWindow.28.29_-_behavior_under_windows)

按照描述的一个办法是，修改下注册表。

---

<div class="post-metadata">

**Author:** ![xiaomoink](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/xiaomoink/32/75671_2.png) [@xiaomoink](https://forum.freemdict.com/u/xiaomoink)\
**Post date:** [2025 年2 月 11 日 06:21 UTC](https://forum.freemdict.com/t/topic/18052/18 "2025-02-11T06:21:32Z")

</div>

朋友，你可以试下我这个golden查词动作，是直接通过命令行查询的，不会出现你说的激活多余窗口这种情况，会自动置顶查词窗口，右键菜单有个选项开启关闭自动恢复窗口，如果开启后焦点会自动回到上一个窗口。同时软件内查词快捷键的自定义设置不影响使用，因为不调用golden内部快捷键

> **[golden查词 - by 墨尹琳 - 动作信息 - Quicker](https://getquicker.net/Sharedaction?code=282a1d39-046c-4db0-0eb5-08dcfa78c549)**
>
> Quicker，Windows效率工具。快速触发 + 自动化。

---

<div class="post-metadata">

**Author:** ![woodcube](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/woodcube/32/68865_2.png) [@woodcube](https://forum.freemdict.com/u/woodcube)\
**Post date:** [2025 年2 月 21 日 13:29 UTC](https://forum.freemdict.com/t/topic/18052/19 "2025-02-21T13:29:47Z")

</div>

这个方法真不错，用命令行调用程序真的是爽歪歪 😆

---

<div class="post-metadata">

**Author:** ![joe2025](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/joe2025/32/83273_2.png) [@joe2025](https://forum.freemdict.com/u/joe2025)\
**Post date:** [2026 年1 月 3 日 03:45 UTC](https://forum.freemdict.com/t/topic/18052/20 "2026-01-03T03:45:16Z")

</div>

The link `goldendict://word` doesn’t work for [Goldendict-ng](https://github.com/xiaoyifang/goldendict-ng) on macOS. When entered in the browser’s address bar it can open the Goldendict-ng app, but not to the specified word, no query happening.

I write an article on how to fix the problem: [Fixing the URL Scheme goldendict://word of GoldenDict-ng on macOS](https://josephtesfaye.com/josephs-blog/productivity/fixing-goldendict/)

---

<div class="post-metadata">

**Author:** ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
**Post date:** [2026 年1 月 4 日 00:56 UTC](https://forum.freemdict.com/t/topic/18052/21 "2026-01-04T00:56:59Z")

</div>

> [@joe2025](#):
>
> goldendict://word

try `goldendict:///word`

[下一页](https://forum.freemdict.com/t/topic/18052.md?page=2)
