# 给goldendict添加在线词典

**URL:** <https://forum.freemdict.com/t/topic/16552>\
**Category:** 软件经验交流展望\
**Created:** [2022 年10 月 26 日 04:09 UTC](https://forum.freemdict.com/t/topic/16552 "2022-10-26T04:09:14Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 26 日 04:09 UTC](https://forum.freemdict.com/t/topic/16552/1 "2022-10-26T04:09:15Z")

</div>

相信大家都知道goldendict可以添加在线网站，原来也知道，但没把体验做好，就放弃了。  
这次参考知乎的一篇文章： [GoldenDict 中设置在线词典 - 知乎 (zhihu.com)](https://zhuanlan.zhihu.com/p/151810213)，利用iframe在goldendict中添加上了在线网站，并查找了点资料，把边框隐藏，大小高度也尽量贴合各个网站，基本可以拿出来见人了。  
也算给大家点回报，毕竟不会编程、CSS、做词典等等，从网站索取了太多。  
[可添加到goldendict的在线英语网站.zip](https://forum.freemdict.com/uploads/short-url/hHojR7LNpCFP8oxfte0UJhzjkg5.zip) (161.6 KB)

该压缩包内含说明readme.txt文件和增加网站截图及效果图一张，体积大了点。

支持网站：  
必应： [Bing 词典](https://www.bing.com/dict/)  
朗文：[https://www.ldoceonline.com/](https://www.ldoceonline.com/)  
牛津：[Oxford Advanced Learner's Dictionary at Oxford Learner's Dictionaries | Find meanings and definitions of words](https://www.oxfordlearnersdictionaries.com/definition/english/)  
韦氏： [Dictionary by Merriam-Webster: America’s most-trusted online dictionary](https://www.merriam-webster.com/)  
剑桥：[Cambridge English–Chinese (Simplified) Dictionary: English to Mandarin Chinese](https://dictionary.cambridge.org/dictionary/english-chinese-simplified)  
麦克米伦：[https://www.macmillandictionary.com/](https://www.macmillandictionary.com/)  
[Dictionary.com](http://Dictionary.com)：[https://www.dictionary.com/](https://www.dictionary.com/)  
wordsmyth： [https://www.wordsmyth.net](https://www.wordsmyth.net)  
AHD：[https://www.ahdictionary.com](https://www.ahdictionary.com)

汉典：[https://www.zdic.net/hans/](https://www.zdic.net/hans/)  
……

其中韦氏的Dictionary和Thesaurus是分开的。

使用方法：  
1、修改“首选项”——“网络”下的设置：  
1.1 勾选“启用Web插件”。（以实现发音功能）  
1.2 勾选“禁止载入来自其它站点的内容”。（以避免每次点击接受cookies）  
1.3 勾选不使用默认的浏览器标识，如果可以修改，可改为EDGE、CHROME等浏览器的，如：  
`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.1836`  
 ![Snipaste_2022-10-26_10-03-45](https://forumcdn.freemdict.com/uploads/default/original/3X/5/a/5ae5488dc00c05ea49f7234494bb66bb91de4faa.png)

2、将下载的压缩包解压到某文件夹下，并在“词典”——“来源”——“网站”下添加，如图：

 ![Snipaste_2022-10-26_10-11-06](https://forumcdn.freemdict.com/uploads/default/original/3X/5/5/5541ac63439f3fc4c0dccedc913a1a94e55b1cad.png)  
注意将其中的文件夹换成你自己的。

3、修改“首选项”——“高级”——“收起序号大于N的文章”的数量。根据自己实际添加的数量来，以避免无法展开。  
 ![Snipaste_2022-10-26_10-42-07](https://forumcdn.freemdict.com/uploads/default/original/3X/e/e/eee1c9f4d976635c93eabd6436b0753445620818.png)

存在问题：

1. 各词典网站展示区域大小不一，所以框架窗口不那么统一。  
2、虽然利用网上找到的资料做背景透明，但只有剑桥和麦克米伦能实现，其它不受影响。

恳请有能力的网友帮助改进。

现效果基本能用，无滚动条，但可以在内容上用滚轮滚动，实际如图：

 ![Snipaste_2022-10-26_11-58-30](https://forumcdn.freemdict.com/uploads/default/original/3X/c/d/cd32e5076d9450581e5f1770857dac0089dd0938.png)  
 ![Snipaste_2022-10-26_12-00-37](https://forumcdn.freemdict.com/uploads/default/original/3X/d/b/dbe2344b38ca5390bbf0a41a3c40eed9fe547163.png)  
 ![Snipaste_2022-10-26_12-00-51](https://forumcdn.freemdict.com/uploads/default/original/3X/d/c/dc829a8c2b700f5bb4acbf051192c54d0f914f81.png)  
 ![Snipaste_2022-10-26_12-01-02](https://forumcdn.freemdict.com/uploads/default/original/3X/3/a/3a9f74ec1c7ff988997ebc357b2047ffc72c3e07.png)  
 ![Snipaste_2022-10-26_12-01-13](https://forumcdn.freemdict.com/uploads/default/original/3X/6/3/633186fbc0e7111816fc0790815c1708940451e4.png)  
 ![Snipaste_2022-10-26_12-01-27](https://forumcdn.freemdict.com/uploads/default/original/3X/0/4/040cac51c0728e034d66639aeb329de4bf40c3b6.png)  
 ![Snipaste_2022-10-26_12-01-37](https://forumcdn.freemdict.com/uploads/default/original/3X/6/2/62f9f28621f780d9b4336850f0a56d0a1027dc1a.png)  
![Snipaste\_2022-10-26\_12-01-45|621x500]  
 ![效果图](https://forumcdn.freemdict.com/uploads/default/original/3X/2/8/28083661a84b452177400b1123d0763b37d810f3.png)

更新：  
2022.10.27 增加Wordsmyth、汉典、AHD。（注：汉典效果相对较差）  
2022.10.28 发现自己搞了乌龙，指定上连距时删掉了一个p，以致国内几家在线词典没搞好。修复并成功添加欧路在线、有道、百度汉语词典、搜狗、知网词典等。  
顺便调整了下div高度，使单一在线网站可以在我的27寸1080P显示器中显示时旁边不出现滚动条（goldendict）。如有不适配你的显示器，请自行调整div标签中的hight值。

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 26 日 09:12 UTC](https://forum.freemdict.com/t/topic/16552/2 "2022-10-26T09:12:19Z")

</div>

[handict.zip](https://forum.freemdict.com/uploads/short-url/sa4Wrmrr0AV6oVQi7iX9V1SsQi.zip) (518 字节)  
补充一个汉典的。  
不如国外的好调整。而且无法发音。

 ![Snipaste_2022-10-26_17-10-33](https://forumcdn.freemdict.com/uploads/default/original/3X/3/8/382359eb18c9335b257410fa521f72511c2cb9e1.png)

---

<div class="post-metadata">

作者： ![ctlmlcfq](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ctlmlcfq/32/6453_2.png) [@ctlmlcfq](https://forum.freemdict.com/u/ctlmlcfq)\
发布日期： [2022 年10 月 27 日 07:53 UTC](https://forum.freemdict.com/t/topic/16552/3 "2022-10-27T07:53:51Z")

</div>

谢谢!能把美国传统加上吗?

我用了必应和欧陆的网址,唯一就是网络延迟高点,而且不知道为什么,一旦使用网络词典,每次查询,信息栏里先跳转的必然是网络查询结果

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 27 日 08:57 UTC](https://forum.freemdict.com/t/topic/16552/4 "2022-10-27T08:57:44Z")

</div>

一楼已全部合并添加进去。包括你想要的AHD，之前之所以没添加，是因为我这边访问不太好。

在线词典受网络影响较严重，如果网络通畅，用着还不错。  
你可以试试把打开快的排在前面，比如必应。

其实再遇到想添加的，完全可以参照自己添加上：

 ![Snipaste_2022-10-27_16-51-51](https://forumcdn.freemdict.com/uploads/default/original/3X/f/d/fd911e92d1cfdadbbb03d10bb1e829ca46468957.png)  
 ![Snipaste_2022-10-27_16-54-28](https://forumcdn.freemdict.com/uploads/default/original/3X/0/b/0bc01478a29912654559d5d773d277afc7b79169.png)

然后把文件另存，照着添加进去。查询单词，对比网站效果，看是需要调整哪里。调一下，保存，goldendict刷新查看效果。直到自己满意。

---

<div class="post-metadata">

作者： ![ctlmlcfq](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/ctlmlcfq/32/6453_2.png) [@ctlmlcfq](https://forum.freemdict.com/u/ctlmlcfq)\
发布日期： [2022 年10 月 27 日 08:59 UTC](https://forum.freemdict.com/t/topic/16552/5 "2022-10-27T08:59:46Z")

</div>

谢谢,晚上我试试,弄不懂再请教你

---

<div class="post-metadata">

作者： ![shiruxue](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shiruxue](https://forum.freemdict.com/u/shiruxue)\
发布日期： [2022 年10 月 27 日 09:19 UTC](https://forum.freemdict.com/t/topic/16552/6 "2022-10-27T09:19:28Z")

</div>

查询界面的谷歌广告很烦人，楼主是怎么解决的？

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 27 日 09:26 UTC](https://forum.freemdict.com/t/topic/16552/7 "2022-10-27T09:26:26Z")

</div>

在一楼写了，是学习的知乎一篇网友的文章。

这个解决方案，其实是利用的iframe框架，对原网页做“位移”，就是

> iframe{ width: 706px; height: 910px; margin-top:-370px;margin-left:-20px;

前面定义了框架的宽度和高度，后面定义了上边距和左边距，通过负值将原本左上角的（0，0）移到（20，370），再绘制一个宽706长910的框架。

---

<div class="post-metadata">

作者： ![shiruxue](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shiruxue](https://forum.freemdict.com/u/shiruxue)\
发布日期： [2022 年10 月 27 日 09:37 UTC](https://forum.freemdict.com/t/topic/16552/8 "2022-10-27T09:37:06Z")

</div>

> [@elisir](#):
>
> 利用的iframe框架，对原网页做“位移”

能去广告，很实用，网速快的话体验赶上本地了。  
回头有空琢磨琢磨欧路。

---

<div class="post-metadata">

作者： ![shiruxue](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shiruxue](https://forum.freemdict.com/u/shiruxue)\
发布日期： [2022 年10 月 27 日 15:11 UTC](https://forum.freemdict.com/t/topic/16552/9 "2022-10-27T15:11:45Z")

</div>

看了楼主写的，也看了楼主引用的知乎文章，又看了知乎引用的文章，觉得如果欧路要用，好像只需把地址路径修改一下，以 file:///E:/dicts/bingdict.html?a=%GDWORD% 为例，把%GDWORD% 改为{w} 即可。只是由于代码作者是以GD写的，欧路用上窗口右侧也会预留一块给GD：

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

而欧路却不适用：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/9/c/9c29047fcc7c4f394a639b8cdf690fd051fd95ef.png)  
（有道的查询结果）  
我不懂代码，不知道能不能去掉，否则直接套用在欧路上就浪费了。

其他的在线词典我没再试。我觉得这代码很好，可以去除页面广告，优化显示界面。尤其是对于那些暂时无法全面抓取数据的在线网站。

感谢楼主推介！

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 27 日 15:18 UTC](https://forum.freemdict.com/t/topic/16552/10 "2022-10-27T15:18:22Z")

</div>

这套在国内在线词典适配不太好，特别是上方的边距，怎么调也无法去掉。不管是有道、百度、搜狗还是其它几个。

以上观点错误。  
在调试时不小心多删除了一个p，所以上边距无效了。改过来就好了。

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2022 年10 月 28 日 10:48 UTC](https://forum.freemdict.com/t/topic/16552/11 "2022-10-28T10:48:16Z")

</div>

在网上查到的新资料，隐藏iframe的滚动条也可以用另一种方式

> iframe{ width: 706px;height：900px； margin-top:-370px;margin-left:-20px; }

::-webkit-scrollbar {   
 display: none;   
 }

> ```
> </style>
> 
> ```
> 
> ```
> <iframe id="a" frameborder="0" allowtransparency="true" scrolling = "yes"; style="background-color:transparent";>
> </iframe>
> 
> <script>
> var word = location.href.slice(location.href.indexOf('?a')+3);
>     
> document.getElementById('a').setAttribute(
> 'src', 
> 'https://dictionary.cambridge.org/dictionary/english-chinese-simplified/' + word);     
> 
> ```

这是一个新特性，不过edge已经支持了。这样就可以不用div层来控制。

---

<div class="post-metadata">

作者： ![elisir](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@elisir](https://forum.freemdict.com/u/elisir)\
发布日期： [2023 年2 月 14 日 00:56 UTC](https://forum.freemdict.com/t/topic/16552/12 "2023-02-14T00:56:45Z")

</div>

在某反动网站上发现了外国网友对在线词典的评价，仅选择几个：

 ![Snipaste_2023-02-14_08-35-00](https://forumcdn.freemdict.com/uploads/default/original/3X/d/f/dfacd60fb45f4f93503a65432f00a770f386642e.jpeg)  
 ![Snipaste_2023-02-14_08-47-26](https://forumcdn.freemdict.com/uploads/default/original/3X/6/8/6888f32a4379d52a55352fba76d60129835553d6.jpeg)  
 ![Snipaste_2023-02-14_08-48-25](https://forumcdn.freemdict.com/uploads/default/original/3X/4/f/4f6d54f50ecba7fba5bba087210d9deb3351d045.png)

---

<div class="post-metadata">

作者： ![ylxdxx](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/y/b2d939/32.png) [@ylxdxx](https://forum.freemdict.com/u/ylxdxx)\
发布日期： [2023 年2 月 15 日 01:55 UTC](https://forum.freemdict.com/t/topic/16552/13 "2023-02-15T01:55:26Z")

</div>

推荐用脚本，把原网页的内容处理好后，再传给GoldenDict，可定制性要高得多

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2023 年2 月 15 日 16:03 UTC](https://forum.freemdict.com/t/topic/16552/14 "2023-02-15T16:03:51Z")

</div>

试了下楼主的在线词典配置文件，在xiaoyifang的GD上不work，只显示一片空白：

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

麻烦 @xiaoyifang 大侠看看是哪里的问题，谢谢！！

---

<div class="post-metadata">

作者： ![Qiuu](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/qiuu/32/62699_2.png) [@Qiuu](https://forum.freemdict.com/u/Qiuu)\
发布日期： [2024 年8 月 18 日 11:06 UTC](https://forum.freemdict.com/t/topic/16552/15 "2024-08-18T11:06:52Z")

</div>

请问法语助手在线词典可以添加吗？需要怎么操作

---

<div class="post-metadata">

作者： ![manwang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/a183cd/32.png) [@manwang](https://forum.freemdict.com/u/manwang)\
发布日期： [2025 年4 月 23 日 10:42 UTC](https://forum.freemdict.com/t/topic/16552/16 "2025-04-23T10:42:54Z")

</div>

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/4/1/4137fb7887277e9d7db23395d9c2ba40e6a66e04.png)  
我的版本是GoldenDict-1.5.0\_(QT\_5123)(64bit)，能看到词典的名字，说明收到内容了，显示内容都是空白。
