├── .editorconfig ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── README.md └── tools ├── addword.py └── chromium_extension ├── README.md ├── css └── app.css ├── format-code.sh ├── images ├── README.md ├── 截图2022-06-14-22-10.png ├── 截图2022-06-14-22-11.png └── 截图2022-07-06 21-10-59.png ├── js ├── app │ ├── box.js │ ├── components.js │ ├── init.js │ ├── pretty-box.js │ ├── search-engine.js │ └── utils.js └── content-script.js ├── manifest.json ├── package.json ├── rules └── remove_content_security_policy.json └── web-components ├── README.md └── x-custom-box.html /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{js,py}] 14 | charset = utf-8 15 | 16 | # 4 space indentation 17 | [*.py] 18 | indent_style = space 19 | indent_size = 4 20 | 21 | # Tab indentation (no size specified) 22 | [Makefile] 23 | indent_style = tab 24 | 25 | # Indentation override for all JS under lib directory 26 | [lib/**.js] 27 | indent_style = space 28 | indent_size = 2 29 | 30 | # Matches the exact files either package.json or .travis.yml 31 | [{package.json,.travis.yml}] 32 | indent_style = space 33 | indent_size = 2 -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tools/chromium_extension/_metadata 2 | /tools/chromium_extension/node_modules 3 | /tools/chromium_extension/package-lock.json 4 | /.idea 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Words Commonly Mispronounced by Chinese Programmers 2 | ## 中国程序员容易发音错误的单词(点击🔊收听正确读音) 3 | 4 | ### 重要更新 5 | - 我们团队最新推出了一款新产品 **[@OfficeSDK](https://officesdk.com)**,拥有强大的文档预览与编辑功能,欢迎了解! 6 | 7 | - chromium扩展:无页面跳转,实时检索英语发音 8 | - 安装 [chromium 扩展](tools/chromium_extension/README.md) 或者 9 | - [外部独立库](https://github.com/jingjingxyk/chinese-programmer-wrong-pronunciation-chromium-extension.git) 10 | - 简洁的单词列表,正确读音不用再打开新网页:https://cpwp.netlify.app/ 11 | - [iOS应用](https://apps.apple.com/cn/app/%E7%8C%BF%E5%8D%95%E8%AF%8D-%E4%B8%AD%E5%9B%BD%E7%A8%8B%E5%BA%8F%E5%91%98%E5%AE%B9%E6%98%93%E5%8F%91%E9%9F%B3%E9%94%99%E8%AF%AF%E7%9A%84%E5%8D%95%E8%AF%8D/id1626487291) 12 | 13 | 14 | | 单词 | 正确发音(英音)| 正确发音(美音)| 错误发音 | 15 | | --- | ----------- | ----------- | ---------- | 16 | | access | [🔊](https://dict.youdao.com/dictvoice?audio=access&type=1) /'ækses/ | [🔊](https://dict.youdao.com/dictvoice?audio=access&type=2) /ˈækses/ | ❌ /ək'ses/ | 17 | | Adobe | [🔊](https://dict.youdao.com/dictvoice?audio=Adobe&type=1) /ə'dəʊbi/ | [🔊](https://dict.youdao.com/dictvoice?audio=Adobe&type=2) /ə'dəʊbi/ | ❌ /əˈdub/ | 18 | | admin | [🔊](https://dict.youdao.com/dictvoice?audio=admin&type=1) /'ædmɪn/ | [🔊](https://dict.youdao.com/dictvoice?audio=admin&type=2) /ˈædmɪn/ | ❌ /ɜ:d'mɪn/ | 19 | | adversarial | [🔊](https://dict.youdao.com/dictvoice?audio=adversarial&type=1) /ˌædvəˈseəriəl/ | [🔊](https://dict.youdao.com/dictvoice?audio=adversarial&type=2) /ˌædvərˈseriəl/ | ❌ /ədˈvɜːrsəriəl/ | 20 | | agile | [🔊](https://dict.youdao.com/dictvoice?audio=agile&type=1) /'ædʒaɪl/ | [🔊](https://dict.youdao.com/dictvoice?audio=agile&type=2) /ˈædʒl/ | ❌ /ə'dʒaɪl/ | 21 | | amazon | [🔊](https://dict.youdao.com/dictvoice?audio=amazon&type=1) /'æməzən/ | [🔊](https://dict.youdao.com/dictvoice?audio=amazon&type=2) /ˈæməzɑːn/ | ❌ /'əmeizən/ /ə'meizən/ | 22 | | analogy | [🔊](https://dict.youdao.com/dictvoice?audio=analogy&type=1) /əˈnælədʒi/ | [🔊](https://dict.youdao.com/dictvoice?audio=analogy&type=2) /əˈnælədʒi/ | ❌ /ænə'lɒdʒi/ | 23 | | Angular | [🔊](https://dict.youdao.com/dictvoice?audio=Angular&type=1) /'æŋgjʊlə/ | [🔊](https://dict.youdao.com/dictvoice?audio=Angular&type=2) /ˈæŋɡjələr/ | ❌ /'æŋɡələ/ /'æŋdʒʌlə/ | 24 | | AJAX | [🔊](https://dict.youdao.com/dictvoice?audio=AJAX&type=1) /'eidʒæks/ | [🔊](https://dict.youdao.com/dictvoice?audio=AJAX&type=2) /'eidʒæks/ | ❌ /ə'dʒʌks/ | 25 | | alias | [🔊](https://dict.youdao.com/dictvoice?audio=alias&type=1) /ˈeɪliəs/ | [🔊](https://dict.youdao.com/dictvoice?audio=alias&type=2) /ˈeɪliəs/ | ❌ /ə'lais/ | 26 | | align | [🔊](https://dict.youdao.com/dictvoice?audio=align&type=1) /əˈlaɪn/ | [🔊](https://dict.youdao.com/dictvoice?audio=align&type=2) /əˈlaɪn/ | ❌ /ə'lidʒen/ | 27 | | Apache | [🔊](https://dict.youdao.com/dictvoice?audio=Apache&type=1) /ə'pætʃɪ/ | [🔊](https://dict.youdao.com/dictvoice?audio=Apache&type=2) /əˈpætʃi/ | ❌ /ʌpʌtʃ/ | 28 | | app | [🔊](https://dict.youdao.com/dictvoice?audio=app&type=1) /æp/ | [🔊](https://dict.youdao.com/dictvoice?audio=app&type=2) /æp/ | ❌ /eipi'pi/ | 29 | | archive | [🔊](https://dict.youdao.com/dictvoice?audio=archive&type=1) /'ɑːkaɪv/ | [🔊](https://dict.youdao.com/dictvoice?audio=archive&type=2) /'ɑːkaɪv/ | ❌ /'ətʃɪv/ | 30 | | array | [🔊](https://dict.youdao.com/dictvoice?audio=array&type=1) /ə'rei/ | [🔊](https://dict.youdao.com/dictvoice?audio=array&type=2) /əˈreɪ/ | ❌ /æ'rei/ | 31 | | ASCII | [🔊](https://dict.youdao.com/dictvoice?audio=ascii&type=1) /'æski/ | [🔊](https://dict.youdao.com/dictvoice?audio=ascii&type=2) /ˈæski/ | ❌ /ɑːsk/ | 32 | | aspect | [🔊](https://dict.youdao.com/dictvoice?audio=aspect&type=1) /'æspekt/ | [🔊](https://dict.youdao.com/dictvoice?audio=aspect&type=2) /ˈæspekt/ | ❌ /ə'spekt/ | 33 | | async | [🔊](https://dict.youdao.com/dictvoice?audio=async&type=1) /əˈsɪŋk/ | [🔊](https://dict.youdao.com/dictvoice?audio=async&type=2) /æˈsɪŋk/ | ❌ /'æsɪŋk/ | 34 | | avatar | [🔊](https://dict.youdao.com/dictvoice?audio=avatar&type=1) /'ævətɑː/ | [🔊](https://dict.youdao.com/dictvoice?audio=avatar&type=2) /ˈævətɑːr/ | ❌ /ə'vʌtɑ/ | 35 | | Azure | [🔊](https://dict.youdao.com/dictvoice?audio=azure&type=1) /'æʒə/ | [🔊](https://dict.youdao.com/dictvoice?audio=azure&type=2) /ˈæʒər/ | ❌ /ˈæzʊʒə/ | 36 | | Bazel | [🔊](https://dict.youdao.com/dictvoice?audio=bazel&type=1) /ˈbeɪzəl/ | [🔊](https://dict.youdao.com/dictvoice?audio=bazel&type=1) /ˈbeɪzəl/ | ❌ /bæ zəl/ | 37 | | bind | [🔊](https://dict.youdao.com/dictvoice?audio=bind&type=1) /baɪnd/ | [🔊](https://dict.youdao.com/dictvoice?audio=bind&type=2) /baɪnd/ | ❌ /bɪnd/ | 38 | | BIOS | [🔊](https://dict.youdao.com/dictvoice?audio=bios&type=1) /ˈbaɪɒs/ | /'baɪɑs/ | ❌ /ˈbɪɒs/ | 39 | | cache | [🔊](https://dict.youdao.com/dictvoice?audio=cache&type=1) /kæʃ/ | [🔊](https://dict.youdao.com/dictvoice?audio=cache&type=2) /kæʃ/ | ❌ /kætʃ/ | 40 | | canal | [🔊](https://dict.youdao.com/dictvoice?audio=canal&type=1) /kəˈnæl/ | [🔊](https://dict.youdao.com/dictvoice?audio=canal&type=2) /kəˈnæl/ | ❌ /ˈkænl/ | 41 | | chaos | [🔊](https://dict.youdao.com/dictvoice?audio=chaos&type=1) /ˈkeɪɒs/ | [🔊](https://dict.youdao.com/dictvoice?audio=chaos&type=2) /ˈkeɪɑːs/ | ❌ /ˈtʃoʊs/ | 42 | | Chrome | [🔊](https://dict.youdao.com/dictvoice?audio=chrome&type=1) /krəʊm/ | [🔊](https://dict.youdao.com/dictvoice?audio=chrome&type=2) /kroʊm/ | ❌ /tʃɔːm/ | 43 | | clang | [🔊](https://dict.youdao.com/dictvoice?audio=clang&type=1) /klæŋ/ | [🔊](https://dict.youdao.com/dictvoice?audio=clang&type=2) /klæŋ/ | ❌ /sɪlæŋ/ | 44 | | context | [🔊](https://dict.youdao.com/dictvoice?audio=context&type=1) /ˈkɒntekst/ | [🔊](https://dict.youdao.com/dictvoice?audio=context&type=2) / ˈkɑːntekst/ | ❌ /kənˈtekst/ | 45 | | Coq | [🔊](https://upload.wikimedia.org/wikipedia/commons/4/47/Fr-coq.ogg) IPA French ['kɔkʲ] 读若拼音“goq” | | ❌ IPA English ['kʰɒk] | 46 | | daemon | [🔊](https://dict.youdao.com/dictvoice?audio=Daemon&type=1) /'diːmən/ | [🔊](https://dict.youdao.com/dictvoice?audio=Daemon&type=2) /ˈdiːmən/ | ❌ /dæmən/ | 47 | | debt | [🔊](https://dict.youdao.com/dictvoice?audio=debt&type=1) /det/ | [🔊](https://dict.youdao.com/dictvoice?audio=debt&type=2) /det/ | ❌ /de'bit/ | 48 | | deny | [🔊](https://dict.youdao.com/dictvoice?audio=deny&type=1) /dɪ'naɪ/ | [🔊](https://dict.youdao.com/dictvoice?audio=deny&type=2) /dɪˈnaɪ/ | ❌ /'dæni/ | 49 | | deprecate | [🔊](https://dict.youdao.com/dictvoice?audio=deprecate&type=1) /ˈdeprəkeɪt/ | [🔊](https://dict.youdao.com/dictvoice?audio=deprecate&type=2) /ˈdeprəkeɪt/ | | 50 | | deque | [🔊](https://dict.youdao.com/dictvoice?audio=deque&type=1) /'dek/ | [🔊](https://dict.youdao.com/dictvoice?audio=deque&type=2) /dɛk/ | ❌ /di'kju/ | 51 | | digest | [🔊](https://dict.youdao.com/dictvoice?audio=digest&type=1) n. /'dɑɪdʒɛst/ v. /dɑɪ'dʒɛst/ | [🔊](https://dict.youdao.com/dictvoice?audio=digest&type=2) /daɪˈdʒest,dɪˈdʒest/ | ❌ /'dɪgɛst/ | 52 | | Dijkstra | [🔊](https://upload.wikimedia.org/wikipedia/commons/8/85/Dijkstra.ogg) Dutch:/ˈdɛikstra/ English:/ˈdaɪkstrə/ | [🔊](https://upload.wikimedia.org/wikipedia/commons/8/85/Dijkstra.ogg) | | 53 | | Django | [🔊](https://dict.youdao.com/dictvoice?audio=Django&type=1) /ˈdʒæŋɡoʊ/ | [🔊](https://dict.youdao.com/dictvoice?audio=Django&type=2) /ˈdʒæŋɡoʊ/ | ❌ /diˈdʒæŋɡoʊ/ | 54 | | doc | [🔊](https://dict.youdao.com/dictvoice?audio=doc&type=1) /dɒk/ | [🔊](https://dict.youdao.com/dictvoice?audio=doc&type=2) /dɒk/ | ❌ /daʊk/ | 55 | | dotnet | [🔊](https://dict.youdao.com/dictvoice?audio=dotnet&type=1) /dɒtnet/ | [🔊](https://dict.youdao.com/dictvoice?audio=dotnet&type=2) /dɑːtnet/ | ❌ /daʊtnet/ | 56 | | edition | [🔊](https://dict.youdao.com/dictvoice?audio=edition&type=1) /ɪˈdɪʃ(ə)n/ | [🔊](https://dict.youdao.com/dictvoice?audio=edition&type=2) /ɪˈdɪʃn/ | ❌ /eˈdɪʃn/ | 57 | | ephemeral | [🔊](https://dict.youdao.com/dictvoice?audio=ephemeral&type=1) /ɪˈfemərəl/ | [🔊](https://dict.youdao.com/dictvoice?audio=ephemeral&type=2) /ɪˈfemərəl/ | ❌ /efe'merəl/ | 58 | | epoch | [🔊](https://dict.youdao.com/dictvoice?audio=epoch&type=1) /ˈiːpɒk/ | [🔊](https://dict.youdao.com/dictvoice?audio=epoch&type=2) /ˈepək/ | ❌ /'ɛpətʃ/ | 59 | | execute | [🔊](https://dict.youdao.com/dictvoice?audio=execute&type=1) /ˈeksɪkjuːt/ | [🔊](https://dict.youdao.com/dictvoice?audio=execute&type=2) /ˈeksɪkjuːt/ | | 60 | | executor | [🔊](https://dict.youdao.com/dictvoice?audio=executor&type=1) /ɪɡˈzekjətə(r)/ | [🔊](https://dict.youdao.com/dictvoice?audio=executor&type=2) /ɪɡˈzekjətər/ | | 61 | | event | [🔊](https://dict.youdao.com/dictvoice?audio=event&type=1) /ɪ'vent/ | [🔊](https://dict.youdao.com/dictvoice?audio=event&type=2) /ɪˈvent/ | ❌ /'ɪvənt/ | 62 | | exit | [🔊](https://dict.youdao.com/dictvoice?audio=exit&type=1) /ˈeksɪt/ | [🔊](https://dict.youdao.com/dictvoice?audio=exit&type=2) /ˈeksɪt; ˈeɡzɪt/ | ❌ /ig'zit/ | 63 | | facade | [🔊](https://dict.youdao.com/dictvoice?audio=facade&type=1) /fə'sɑːd/ | [🔊](https://dict.youdao.com/dictvoice?audio=facade&type=2) /fəˈsɑːd/ | ❌ /'feikeid/ | 64 | | fedora | [🔊](https://dict.youdao.com/dictvoice?audio=fedora&type=1) /fɪ'dɔːrə/ | [🔊](https://dict.youdao.com/dictvoice?audio=fedora&type=2) /fɪˈdɔːrə/ | ❌ /'fedərə/ | 65 | | format | [🔊](https://dict.youdao.com/dictvoice?audio=format&type=1) /'fɔːmæt/ | [🔊](https://dict.youdao.com/dictvoice?audio=format&type=2) /ˈfɔːrmæt/ | ❌ /fɔ'mæt/ | 66 | | gauge | [🔊](https://dict.youdao.com/dictvoice?audio=gauge&type=1) /ɡeɪdʒ/ | [🔊](https://dict.youdao.com/dictvoice?audio=gauge&type=2) /ɡeɪdʒ/ | ❌ /ɡɑudʒ/ | 67 | | Git | [🔊](https://dict.youdao.com/dictvoice?audio=git&type=1) /ɡɪt/ | [🔊](https://dict.youdao.com/dictvoice?audio=git&type=2) /ɡɪt/ | ❌ /dʒɪt/ | 68 | | GNU | [🔊](https://upload.wikimedia.org/wikipedia/commons/2/24/En-gnu.ogg) /gnu:/ | [🔊](https://upload.wikimedia.org/wikipedia/commons/2/24/En-gnu.ogg) /gnuː,gnjuː/ | | 69 | | Grafana | [🔊](http://www.howtopronounce.cc/file/e204a97ed1e440c5ab15ea0117beb955.mp3) /grəˈfɑːnˌɑː/ | [🔊](http://www.howtopronounce.cc/file/e204a97ed1e440c5ab15ea0117beb955.mp3 ) /grəˈfɑːnˌɑː/ | | 70 | | GraphQL | [🔊](https://dict.youdao.com/dictvoice?audio=GraphQL&type=1) /græf kju ɛl/ | [🔊](https://dict.youdao.com/dictvoice?audio=GraphQL&type=2) /græf kju ɛl/ | ❌ /dʒɪgræf kju ɛl/ | 71 | | GUI | [🔊](https://dict.youdao.com/dictvoice?audio=GUI&type=1) /ˈɡu:i/ | [🔊](https://dict.youdao.com/dictvoice?audio=GUI&type=2) /ˈɡu:i/ | | 72 | | Haskell | [🔊](https://dict.youdao.com/dictvoice?audio=haskell&type=1) /ˈhæskəl/ | [🔊](https://dict.youdao.com/dictvoice?audio=haskell&type=2) /ˈhæskəl/ | ❌ /hæˈskəl/ | 73 | | height | [🔊](https://dict.youdao.com/dictvoice?audio=height&type=1) /haɪt/ | [🔊](https://dict.youdao.com/dictvoice?audio=height&type=2) /haɪt/ | ❌ /heɪt/ | 74 | | hidden | [🔊](https://dict.youdao.com/dictvoice?audio=hidden&type=1) /'hɪdn/ | [🔊](https://dict.youdao.com/dictvoice?audio=hidden&type=2) /ˈhɪdn/ | ❌ /'haɪdn/ | 75 | | IEEE | [🔊](https://dict.youdao.com/dictvoice?audio=I_triple_e&type=1) /aɪ ˈtrɪpəl i/ | [🔊](https://dict.youdao.com/dictvoice?audio=I_triple_e&type=2) /aɪ ˈtrɪpəl i/ | ❌ /'aɪ'iː'iː'iː/ | 76 | | image | [🔊](https://dict.youdao.com/dictvoice?audio=image&type=1) /'ɪmɪdʒ/ | [🔊](https://dict.youdao.com/dictvoice?audio=image&type=2) /ˈɪmɪdʒ/ | ❌ /ɪ'meɪdʒ/ | 77 | | implement | [🔊](https://dict.youdao.com/dictvoice?audio=implement&type=1) /'ɪmplɪm(ə)nt/ | [🔊](https://dict.youdao.com/dictvoice?audio=implement&type=2) /ˈɪmplɪmənt/ /ˈɪmpləˌment/ | ❌ /ɪm'plem(ə)nt/ | 78 | | integer | [🔊](https://dict.youdao.com/dictvoice?audio=integer&type=1) /'ɪntɪdʒə/ | [🔊](https://dict.youdao.com/dictvoice?audio=integer&type=2) /ˈɪntɪdʒər/ | ❌ /ˈɪntaɪgə/ | 79 | | issue | [🔊](https://dict.youdao.com/dictvoice?audio=issue&type=1) /'ɪʃuː/ | [🔊](https://dict.youdao.com/dictvoice?audio=issue&type=2) /ˈɪʃuː/ | ❌ /ˈaɪʃuː/ | 80 | | Java | [🔊](https://dict.youdao.com/dictvoice?audio=java&type=1) /'dʒɑːvə/ | [🔊](https://dict.youdao.com/dictvoice?audio=java&type=2) /ˈdʒɑːvə/ | | 81 | | jpg| [🔊](https://dict.youdao.com/dictvoice?audio=JPEG&type=1) /'dʒeɪpeɡ/ | [🔊](https://dict.youdao.com/dictvoice?audio=JPEG&type=2) /'dʒeɪpeɡ/ | ❌ /ˈdʒeɪˈpi:ˈdʒiː/ | 82 | | key | [🔊](https://dict.youdao.com/dictvoice?audio=key&type=1) /kiː/ | [🔊](https://dict.youdao.com/dictvoice?audio=key&type=2) /kiː/ | ❌ /kei/ | 83 | | kubernetes* | [🔊](https://content.swncdn.com/biblestudytools/audio/lexicons/greek-mp3/2942g.mp3) /kubз'netɪs/ | [🔊](https://content.swncdn.com/biblestudytools/audio/lexicons/greek-mp3/2942g.mp3) /kuːbə˞'netiz/ | | 84 | | lambda | [🔊](https://dict.youdao.com/dictvoice?audio=lambda&type=1) /ˈlæmdə/ | [🔊](https://dict.youdao.com/dictvoice?audio=lambda&type=2) /ˈlæmdə/ | ❌ /ˈlɒŋmdɑ/ | 85 | | Ldap | [🔊](https://dict.youdao.com/dictvoice?audio=ldap&type=1) /el'dæp/ | [🔊](https://dict.youdao.com/dictvoice?audio=ldap&type=2) /el'dæp/ | ❌ /el'daːp/ | 86 | | legacy | [🔊](https://dict.youdao.com/dictvoice?audio=legacy&type=1) /'leɡəsi/ | [🔊](https://dict.youdao.com/dictvoice?audio=legacy&type=2) /'leɡəsi/ | ❌ /'li:gasi/ | 87 | | linear | [🔊](https://dict.youdao.com/dictvoice?audio=linear&type=1) /'lɪnɪə/ | [🔊](https://dict.youdao.com/dictvoice?audio=linear&type=2) /ˈlɪniər/ | ❌ /'laɪə/ | 88 | | LINQ | [🔊](https://dict.youdao.com/dictvoice?audio=link&type=1) /lɪŋk/ | [🔊](https://dict.youdao.com/dictvoice?audio=link&type=2) /lɪŋk/ | ❌ /lɪŋkju:/ | 89 | | Linux | [🔊](https://dict.youdao.com/dictvoice?audio=linux&type=1) /'lɪnəks/ | [🔊](https://dict.youdao.com/dictvoice?audio=linux&type=2) /ˈlaɪnəks/ /ˈlɪnəks/ | ❌ /ˈlɪnʌks/ /ˈlɪnjuːks/ | 90 | | locale | [🔊](https://dict.youdao.com/dictvoice?audio=locale&type=1) /ləʊ'kɑːl/ | [🔊](https://dict.youdao.com/dictvoice?audio=locale&type=2) /loʊˈkæl/ | ❌ /ˈloʊk(ə)l/ | 91 | | Lucene | [🔊](https://dict.youdao.com/dictvoice?audio=lucene&type=1) /lu'siːn/ | [🔊](https://dict.youdao.com/dictvoice?audio=lucene&type=2) /lu'siːn/ | ❌ /'lu:sən/ | 92 | | macro | [🔊](https://dict.youdao.com/dictvoice?audio=macro&type=1) /ˈmækrəʊ/ | [🔊](https://dict.youdao.com/dictvoice?audio=macro&type=2) /ˈmækroʊ/ | ❌ /ˈmakroʊ/ | 93 | | main | [🔊](https://dict.youdao.com/dictvoice?audio=main&type=1) /meɪn/ | [🔊](https://dict.youdao.com/dictvoice?audio=main&type=2) /meɪn/ | ❌ /mɪn/ | 94 | | margin | [🔊](https://dict.youdao.com/dictvoice?audio=margin&type=1) /'mɑːdʒɪn/ | [🔊](https://dict.youdao.com/dictvoice?audio=margin&type=2) /ˈmɑːrdʒɪn/ | ❌ /'mʌgɪn/ | 95 | | matrix | [🔊](https://dict.youdao.com/dictvoice?audio=matrix&type=1) /ˈmeɪtrɪks/ | [🔊](https://dict.youdao.com/dictvoice?audio=matrix&type=2) /ˈmeɪtrɪks/ | ❌ /ˈmɑ:trɪks/ | 96 | | maven | [🔊](https://dict.youdao.com/dictvoice?audio=maven&type=1) /'meɪvn/ | [🔊](https://dict.youdao.com/dictvoice?audio=maven&type=2) /ˈmeɪvn/ | ❌ /'maːvn/ | 97 | | max | [🔊](https://dict.youdao.com/dictvoice?audio=max&type=1) /mæks/ | [🔊](https://dict.youdao.com/dictvoice?audio=max&type=2) /mæks/ | ❌ /mɑ:ks/ | 98 | | Microsoft | [🔊](https://dict.youdao.com/dictvoice?audio=Microsoft&type=1) /'maikrəusɔft/ | [🔊](https://dict.youdao.com/dictvoice?audio=Microsoft&type=2) /ˈmaɪkrəsɔːft/ | ❌ /'mikrəusɔft/ | 99 | | migrate | [🔊](https://dict.youdao.com/dictvoice?audio=migrate&type=1) /maɪˈɡreɪt/ | [🔊](https://dict.youdao.com/dictvoice?audio=migrate&type=2) /ˈmaɪɡreɪt/ | ❌ /ˈmɪɡreɪt/ | 100 | | miscellaneous | [🔊](https://dict.youdao.com/dictvoice?audio=miscellaneous&type=1) /ˌmɪsəˈleɪniəs/ | [🔊](https://dict.youdao.com/dictvoice?audio=miscellaneous&type=2) /ˌmɪsəˈleɪniəs/ | | 101 | | module | [🔊](https://dict.youdao.com/dictvoice?audio=module&type=1) /'mɒdjuːl/ | [🔊](https://dict.youdao.com/dictvoice?audio=module&type=2) /ˈmɑːdʒuːl/ | ❌ /'məʊdl/ | 102 | | native | [🔊](https://dict.youdao.com/dictvoice?audio=native&type=1) /ˈneɪtɪv/ | [🔊](https://dict.youdao.com/dictvoice?audio=native&type=2) /ˈneɪtɪv/ | ❌ /ˈnætɪv/ | 103 | | nginx | Engine X | Engine X | | 104 | | null | [🔊](https://dict.youdao.com/dictvoice?audio=null&type=1) /nʌl/ | [🔊](https://dict.youdao.com/dictvoice?audio=null&type=2) /nʌl/ | ❌ /naʊ/ | 105 | | obsolete | [🔊](https://dict.youdao.com/dictvoice?audio=obsolete&type=1) /ˈɒbsəliːt/ | [🔊](https://dict.youdao.com/dictvoice?audio=obsolete&type=2) /ˌɑːbsəˈliːt/ | | 106 | | OS X | OS ten | OS ten | ❌ /ɔs eks/ | 107 | | phantom | [🔊](https://dict.youdao.com/dictvoice?audio=phantom&type=1) /'fæntəm/ | [🔊](https://dict.youdao.com/dictvoice?audio=phantom&type=2) /ˈfæntəm/ | ❌ /'pæntəm/ | 108 | | parameter | [🔊](https://dict.youdao.com/dictvoice?audio=parameter&type=1) /pə'ræmɪtə/ | [🔊](https://dict.youdao.com/dictvoice?audio=parameter&type=2) /pəˈræmɪtər/ | ❌ /'pærəmɪtə/ | 109 | | premise | [🔊](https://dict.youdao.com/dictvoice?audio=premise&type=1) /ˈpremɪs/ | [🔊](https://dict.youdao.com/dictvoice?audio=premise&type=2) /ˈpremɪs/ | ❌ /prɪ'mɪs/| 110 | | privilege | [🔊](https://dict.youdao.com/dictvoice?audio=privilege&type=1) /'prɪvəlɪdʒ/ | [🔊](https://dict.youdao.com/dictvoice?audio=privilege&type=2) /ˈprɪvəlɪdʒ/ | ❌ /'prɪvɪlɪdʒ/ | 111 | | probe | [🔊](https://dict.youdao.com/dictvoice?audio=probe&type=1) /prəʊb/ | [🔊](https://dict.youdao.com/dictvoice?audio=probe&type=2) /proʊb/ | ❌ /proʊbi/ | 112 | | Prometheus | [🔊](https://dict.youdao.com/dictvoice?audio=prometheus&type=1) /prə-ˈmē-thē-əs/ | [🔊](https://dict.youdao.com/dictvoice?audio=prometheus&type=2) /pro'miθɪəs/ | | 113 | | putty | [🔊](https://dict.youdao.com/dictvoice?audio=putty&type=1) /ˈpʌti/ | [🔊](https://dict.youdao.com/dictvoice?audio=putty&type=2) /ˈpʌti/ | ❌ /ˈpuːti/ | 114 | | Qt | [🔊](https://dict.youdao.com/dictvoice?audio=cute&type=1) /kjuːt/ | [🔊](https://dict.youdao.com/dictvoice?audio=cute&type=2) /kjuːt/ | | 115 | | query | [🔊](https://dict.youdao.com/dictvoice?audio=query&type=1) /'kwɪəri/ | [🔊](https://dict.youdao.com/dictvoice?audio=query&type=2) /ˈkwɪri/ | ❌ /'kwaɪri/ | 116 | | Realm | [🔊](https://dict.youdao.com/dictvoice?audio=realm&type=1) /relm/ | [🔊](https://dict.youdao.com/dictvoice?audio=realm&type=2) /relm/ | ❌ /riəlm/ | 117 | | reconcile | [🔊](https://dict.youdao.com/dictvoice?audio=reconcile&type=1) /ˈrekənsaɪl/ | [🔊](https://dict.youdao.com/dictvoice?audio=reconcile&type=2) /ˈrekənsaɪl/ | | 118 | | Redux | [🔊](https://dict.youdao.com/dictvoice?audio=redux&type=1) /ri'dʌks/ | [🔊](https://dict.youdao.com/dictvoice?audio=redux&type=2) /ri'dʌks/ | ❌ /'ridju:ks/ | 119 | | resume | [🔊](https://dict.youdao.com/dictvoice?audio=resume&type=1) /rɪ'zju:m/ | [🔊](https://dict.youdao.com/dictvoice?audio=resume&type=2) /rɪˈzuːm/ | ❌ /rɪ'sju:m/ | 120 | | résumé | [🔊](https://dict.youdao.com/dictvoice?audio=résumé&type=1) /rezjumeɪ/ | [🔊](https://dict.youdao.com/dictvoice?audio=résumé&type=2) /ˈrezəmeɪ/ | ❌ /rɪ'sju:m/ | 121 | | resolved | [🔊](https://dict.youdao.com/dictvoice?audio=resolved&type=1) /rɪ'zɒlvd/ | [🔊](https://dict.youdao.com/dictvoice?audio=resolved&type=2) /rɪˈzɑːlvd/ | ❌ /rɪ'səʊvd/ | 122 | | resort | [🔊](https://dict.youdao.com/dictvoice?audio=resort&type=1) /rɪˈzɔ:t/ | [🔊](https://dict.youdao.com/dictvoice?audio=resort&type=2) /rɪˈzɔːrt/ | ❌ /rɪˈsɔ:t/ | 123 | | retina | [🔊](https://dict.youdao.com/dictvoice?audio=retina&type=1) /'retɪnə/ | [🔊](https://dict.youdao.com/dictvoice?audio=retina&type=2) /ˈretɪnə/ | ❌ /ri'tina/ | 124 | | RISC-V | [🔊](https://dict.youdao.com/dictvoice?audio=risk-five&type=1) /'rɪsk faɪv/ | [🔊](https://dict.youdao.com/dictvoice?audio=risk-five&type=2) /'rɪsk faɪv/ | ❌ /'rɪsk v/ | 125 | | route | [🔊](https://dict.youdao.com/dictvoice?audio=route&type=1) /ruːt/ | [🔊](https://dict.youdao.com/dictvoice?audio=route&type=2) /ruːt,raʊt/ | ❌ /rəʊt/ | 126 | | San Jose | [🔊](https://dict.youdao.com/dictvoice?audio=san%20jose&type=1) /sænhəu'zei/ | [🔊](https://dict.youdao.com/dictvoice?audio=san%20jose&type=2) /sænhəu'zei/ | ❌ /sæn'ju:s/ | 127 | | safari | [🔊](https://dict.youdao.com/dictvoice?audio=safari&type=1) /sə'fɑːrɪ/ | [🔊](https://dict.youdao.com/dictvoice?audio=safari&type=2) /səˈfɑːri/ | ❌ /sæfərɪ/ | 128 | | scheme | [🔊](https://dict.youdao.com/dictvoice?audio=scheme&type=1) /skiːm/ | [🔊](https://dict.youdao.com/dictvoice?audio=scheme&type=2) /skiːm/ | ❌ /s'kæmə/ | 129 | | scala | [🔊](https://dict.youdao.com/dictvoice?audio=scala&type=1) /ˈskɑːlɑ/ | [🔊](https://dict.youdao.com/dictvoice?audio=scala&type=2) /ˈskɑːlɑ/ | ❌ /ˈskæːlɑ/ | 130 | | segue | [🔊](https://dict.youdao.com/dictvoice?audio=segue&type=1) /'sɛɡwe/ | [🔊](https://dict.youdao.com/dictvoice?audio=segue&type=2) /ˈseɡweɪ/ | ❌ /se'dʒ/ | 131 | | SQL | /ˈsiːkwəl/ /ˈesˈkjuːˈel/ | /ˈsiːkwəl/ /ˈesˈkjuːˈel/ | ❌ /sərk(ə)l/ | 132 | | sudo | /'suːduː/ | /'suːduː/ | | 133 | | suite | [🔊](https://dict.youdao.com/dictvoice?audio=suite&type=1) /swiːt/ | [🔊](https://dict.youdao.com/dictvoice?audio=suite&type=2) /swiːt/ | ❌ /sjuːt/ | 134 | | telemetry | [🔊](https://dict.youdao.com/dictvoice?audio=telemetry&type=1) /təˈlemətri/ | [🔊](https://dict.youdao.com/dictvoice?audio=telemetry&type=2) /təˈlemətri/ | ❌ /ˈtelɪmətri/ | 135 | | thymeleaf | [🔊](https://dict.youdao.com/dictvoice?audio=thymeleaf&type=1) /ˈtaɪmˌlɪːf/ | [🔊](https://dict.youdao.com/dictvoice?audio=thymeleaf&type=2) /ˈtaɪmˌlɪːf/ | ❌ /θiːmɪlɪːf/ | 136 | | tuple | [🔊](https://dict.youdao.com/dictvoice?audio=tuple&type=1) /tjʊpəl/ | [🔊](https://dict.youdao.com/dictvoice?audio=tuple&type=2) /tuːpəl/ | | 137 | | typical | [🔊](https://dict.youdao.com/dictvoice?audio=typical&type=1) /'tɪpɪkl/ | [🔊](https://dict.youdao.com/dictvoice?audio=typical&type=2) /ˈtɪpɪkl/ | ❌ /'taɪpɪkəl/ | 138 | | Ubuntu | [🔊](https://upload.wikimedia.org/wikipedia/commons/b/b5/En-Ubuntu_pronunciation.oga) /ʊ'bʊntʊ/ | [🔊](https://upload.wikimedia.org/wikipedia/commons/b/b5/En-Ubuntu_pronunciation.oga) /ʊ'bʊntʊ/ | ❌ /juː'bʊntʊ/ | 139 | | UEFI | U-E-F-I | U-E-F-I | ❌ /jufi/ /ɔːfi/ | 140 | | Vagrant | [🔊](https://dict.youdao.com/dictvoice?audio=Vagrant&type=1) /ˈveɪɡrənt/ | [🔊](https://dict.youdao.com/dictvoice?audio=Vagrant&type=2) /ˈveɪɡrənt/ | /ˈvagɹent/ | 141 | | variable | [🔊](https://dict.youdao.com/dictvoice?audio=variable&type=1) /'veəriəbl/ | [🔊](https://dict.youdao.com/dictvoice?audio=variable&type=2) /ˈveriəbl,ˈværiəbl/ | ❌ /və'raiəbl/ | 142 | | verbose | [🔊](https://dict.youdao.com/dictvoice?audio=verbose&type=1) /vɜːˈbəʊs/ | [🔊](https://dict.youdao.com/dictvoice?audio=verbose&type=2) /vɜːrˈboʊs/ | ❌ /'vɜːrboʊs/ | 143 | | vue | [🔊](https://dict.youdao.com/dictvoice?audio=vue&type=1) /v'ju:/ | [🔊](https://dict.youdao.com/dictvoice?audio=vue&type=2) /v'ju:/ | ❌ /v'ju:i/ | 144 | | width | [🔊](https://dict.youdao.com/dictvoice?audio=width&type=1) /wɪdθ/ | [🔊](https://dict.youdao.com/dictvoice?audio=width&type=2) /wɪdθ,wɪtθ/ | ❌ /waɪdθ/ | 145 | | YouTube | [🔊](https://dict.youdao.com/dictvoice?audio=youtube&type=1) /'juː'tjuːb/ | [🔊](https://dict.youdao.com/dictvoice?audio=youtube&type=2) /'juː'tjuːb/ | ❌ /'juː'tʊbɪ/ | 146 | | Vite | [🔊](https://dict.youdao.com/dictvoice?audio=vite&type=1) /vit/ | [🔊](https://dict.youdao.com/dictvoice?audio=vite&type=2) /vit/ | ❌ /vaɪt/ | 147 | 148 | ### 附注 149 | * 无页面跳转,页面嵌入搜索引擎和实时检索英语发音,请安装[chromium 扩展](tools/chromium_extension/README.md) 150 | * [chromium 扩展新增功能截图](tools/chromium_extension/images/README.md) 151 | * 当使用简名 ‘Kube’ 称呼 ‘Kubernetes’ 时, 发音则与 ‘cube’(/kjuːb/) 一致 152 | 153 | ### 相关链接 154 | * 真人发音:https://www.bilibili.com/video/bv1nv411i7z3 (by @hailintao) 155 | * 简洁的单词列表,正确读音不用再打开新网页:https://cpwp.netlify.app/ (by @antfu7) 156 | * 国际音标严式记音(纽约音)https://github.com/b1f6c1c4/programming-pronunciations-en_US (by @b1f6c1c4) 157 | * 单词连读:https://corrector.justsong.cn/ (by [@songquanpeng](https://github.com/songquanpeng/pronunciation-corrector)) 158 | * [iOS app](https://apps.apple.com/cn/app/%E7%8C%BF%E5%8D%95%E8%AF%8D-%E4%B8%AD%E5%9B%BD%E7%A8%8B%E5%BA%8F%E5%91%98%E5%AE%B9%E6%98%93%E5%8F%91%E9%9F%B3%E9%94%99%E8%AF%AF%E7%9A%84%E5%8D%95%E8%AF%8D/id1626487291) (by @Chang12) 159 | * [chromium系浏览器扩展,无页面跳转,实时检索英语发音](https://github.com/jingjingxyk/chinese-programmer-wrong-pronunciation-chromium-extension.git) (by @jingjingxyk) 160 | 161 | ### 说明 162 | 1. 本着简单的原则, 又为了避免程序猿们出现选择困难症, '正确音标'采用了最接近有道词典音频的英式DJ音标,不代表其唯一性 163 | 1. 专业在线英语词典请参考: [在线英语词典哪个比较好?](https://www.zhihu.com/question/19707759) 164 | 165 | ### 参考资料 166 | 1. https://www.zhihu.com/question/19739907 167 | 2. https://www.v2ex.com/t/131094 168 | 3. https://www.v2ex.com/t/309350 169 | 4. https://www.v2ex.com/t/63781 170 | 5. https://www.v2ex.com/t/246033 171 | 6. https://www.v2ex.com/t/342087 172 | 173 | ### Star History 174 | 175 | [![Star History Chart](https://api.star-history.com/svg?repos=shimohq/chinese-programmer-wrong-pronunciation&type=Date)](https://star-history.com/#shimohq/chinese-programmer-wrong-pronunciation&Date) 176 | -------------------------------------------------------------------------------- /tools/addword.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: UTF-8 -*- 3 | """ 4 | Create the description for a word to be added to the word list 5 | Usage: addword.py 6 | """ 7 | import re 8 | import sys 9 | import urllib.request 10 | from bs4 import BeautifulSoup 11 | 12 | 13 | def main(): 14 | """Generate the information with pronunciations for a word to be added to the word list""" 15 | if len(sys.argv) != 2: 16 | print(__doc__) 17 | sys.exit(1) 18 | word = sys.argv[1] 19 | pronunciations = get_pronunciations(word) 20 | britsh_en = '[🔊](' + pronunciations[0][0] + ')' + ' ' + '/' + pronunciations[0][1] + '/' 21 | american_en = '[🔊](' + pronunciations[1][0] + ')' + ' ' + '/' + pronunciations[1][1] + '/' 22 | line = '| ' + word + ' | ' + britsh_en + ' | ' + american_en + ' | ' + ' ' + '|' 23 | print(line) 24 | 25 | 26 | def get_pronunciations(word): 27 | """Return the word's pronouciation URLs and phonetic transcriptions 28 | from youdao.com if available""" 29 | word = word.strip() 30 | word_url = 'https://dict.youdao.com/w/en/' + word 31 | pron_url = 'https://dict.youdao.com/dictvoice?audio='+ word + '&' 32 | britsh_en = [" ", " "] 33 | american_en = [" ", " "] 34 | try: 35 | response = urllib.request.urlopen(word_url).read() 36 | soup = BeautifulSoup(response, 'html.parser') 37 | spans = soup.find_all('span', {'class': 'pronounce'}) 38 | lines = [span.get_text() for span in spans] 39 | match = re.findall(r'\[.+\]', lines[0]) 40 | britsh_en[0] = pron_url + 'type=1' 41 | britsh_en[1] = match[0].replace('[', '').replace(']', '') 42 | match = re.findall(r'\[.+\]', lines[1]) 43 | american_en[0] = pron_url + 'type=2' 44 | american_en[1] = match[0].replace('[', '').replace(']', '') 45 | except: 46 | return britsh_en, american_en 47 | 48 | return britsh_en, american_en 49 | 50 | 51 | if __name__ == '__main__': 52 | main() 53 | -------------------------------------------------------------------------------- /tools/chromium_extension/README.md: -------------------------------------------------------------------------------- 1 | # 无页面跳转收听正确读音 的 chromium 扩展 2 | 3 | ## 使用说明 4 | 5 | 1. 点击第一列,调用的是搜索框页面 6 | 1. 点击第二列和第三列,调用的播放音频功能 7 | 8 | ## [获得最新版扩展](https://github.com/jingjingxyk/chinese-programmer-wrong-pronunciation-chromium-extension.git) 9 | 10 | ## 手动安装扩展 11 | 12 | > 1. 下载 [chinese-programmer-wrong-pronunciation](https://github.com/shimohq/chinese-programmer-wrong-pronunciation/archive/refs/heads/master.zip) 然后解压,找到 `tools/chromium_extension` 子目录 13 | > 2. 打开 Chrome,输入: `chrome://extensions/` 14 | > 3. 勾选 Developer Mode 15 | > 4. 选择 Load unpacked extension... 然后定位到刚才解压的文件夹里面的 `tools/chromium_extension` 目录,确定 16 | > 5. 这就安装好了,去掉 Developer Mode 勾选。 17 | > 6. 打开[`https://github.com/shimohq/chinese-programmer-wrong-pronunciation.git`](https://github.com/shimohq/chinese-programmer-wrong-pronunciation.git)点击单词,即可听正确的单词读音 18 | 19 | ## 扩展开发参考 20 | 21 | 1. [content_scripts](https:////developer.chrome.com/docs/extensions/mv3/content_scripts/) 22 | 1. [Declare permissions](https:////developer.chrome.com/docs/extensions/mv3/declare_permissions/) 23 | 1. [ReplaceGoogleCDN](https://github.com/justjavac/ReplaceGoogleCDN.git) 24 | 25 | ## note 26 | 27 | ```text 28 | https://dict.youdao.com/dictvoice?audio=parameter&type=1 29 | 30 | ``` 31 | -------------------------------------------------------------------------------- /tools/chromium_extension/css/app.css: -------------------------------------------------------------------------------- 1 | tr:hover { 2 | border: 8px solid #ddd !important; 3 | border-radius: 8px !important; 4 | box-shadow: 5px 5px 15px #daf5fe !important; 5 | 6 | color: #fff !important; 7 | background-color: #3ec487 !important; 8 | /* 9 | font-weight: 200; 10 | font-size: 1.1rem; 11 | */ 12 | } 13 | 14 | #chinese-programmer-wrong-pronunciation-custom-iframe-box { 15 | border: 8px solid #ddd !important; 16 | border-radius: 8px !important; 17 | box-shadow: 5px 5px 15px #daf5fe !important; 18 | z-index: 999; 19 | position: fixed !important; 20 | } 21 | .chinese-programmer-wrong-pronunciation-custom-iframe-box { 22 | right: 0 !important; 23 | top: 64px !important; 24 | } 25 | 26 | .chinese-programmer-wrong-pronunciation-custom-iframe-box-hidden { 27 | display: none; 28 | } 29 | 30 | #chinese-programmer-wrong-pronunciation-custom-iframe { 31 | width: 100%; 32 | height: 100%; 33 | min-width: 700px !important; 34 | min-height: 600px !important; 35 | } 36 | 37 | .chinese-programmer-wrong-pronunciation-custom-tool-bar { 38 | position: absolute; 39 | right: -5px; 40 | top: -32px; 41 | font-size: 16px; 42 | } 43 | 44 | .chinese-programmer-wrong-pronunciation-custom-window-close-icon { 45 | margin-right: 4px; 46 | margin-left: 10px; 47 | } 48 | .chinese-programmer-wrong-pronunciation-custom-tool-bar-setup { 49 | margin-right: 10px; 50 | font-size: 20px; 51 | } 52 | 53 | .chinese-programmer-wrong-pronunciation-custom-note-reset { 54 | font-size: 16px; 55 | color: #c5955d; 56 | } 57 | -------------------------------------------------------------------------------- /tools/chromium_extension/format-code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | set -exu 4 | 5 | __DIR__=$(cd "$(dirname "$0")";pwd) 6 | cd ${__DIR__} 7 | 8 | npm run format-code -------------------------------------------------------------------------------- /tools/chromium_extension/images/README.md: -------------------------------------------------------------------------------- 1 | # 新增功能截图 2 | 3 | ## 嵌入搜索引擎 有道搜索 4 | 5 | ![](https://github.com/jingjingxyk/chinese-programmer-wrong-pronunciation/blob/master/tools/chromium_extension/images/%E6%88%AA%E5%9B%BE2022-06-14-22-11.png?raw=true) 6 | 7 | ## 嵌入搜索引擎 谷歌搜索 8 | 9 | ![](https://github.com/jingjingxyk/chinese-programmer-wrong-pronunciation/blob/master/tools/chromium_extension/images/截图2022-06-14-22-10.png?raw=true) 10 | -------------------------------------------------------------------------------- /tools/chromium_extension/images/截图2022-06-14-22-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shimohq/chinese-programmer-wrong-pronunciation/288ab62e3ab9c022a48db81a81bf775c8e8c7e45/tools/chromium_extension/images/截图2022-06-14-22-10.png -------------------------------------------------------------------------------- /tools/chromium_extension/images/截图2022-06-14-22-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shimohq/chinese-programmer-wrong-pronunciation/288ab62e3ab9c022a48db81a81bf775c8e8c7e45/tools/chromium_extension/images/截图2022-06-14-22-11.png -------------------------------------------------------------------------------- /tools/chromium_extension/images/截图2022-07-06 21-10-59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shimohq/chinese-programmer-wrong-pronunciation/288ab62e3ab9c022a48db81a81bf775c8e8c7e45/tools/chromium_extension/images/截图2022-07-06 21-10-59.png -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/box.js: -------------------------------------------------------------------------------- 1 | import * as utils from "./utils.js"; 2 | import * as components from "./components.js"; 3 | import * as searchEngine from "./search-engine.js"; 4 | 5 | let goToSearchPronounce = (word) => { 6 | let search_engine_name = "goToGoogleSearch"; 7 | search_engine_name = "goToYouDaoSearch"; 8 | // search_engine_name = "goToBingDictSearch"; 9 | // search_engine_name = "goToBingSearch"; 10 | //search_engine_name = "gotToYouDaoSearch"; 11 | let tab = "current_tab"; 12 | 13 | let opener = components.getSearchEngineOpener(); 14 | if (opener && opener.expired_date) { 15 | if (opener.expired_date > new Date().getTime()) { 16 | if (opener.search_engine_name) { 17 | search_engine_name = opener.search_engine_name; 18 | } 19 | if (opener.tab) { 20 | tab = opener.tab; 21 | } 22 | } 23 | } 24 | if (search_engine_name && searchEngine[search_engine_name]) { 25 | console.log(word); 26 | let url = searchEngine[search_engine_name](word); 27 | console.log(url); 28 | if (tab === "new_tab") { 29 | window.open(url, "_blank"); 30 | } else { 31 | let iframe = components.getIframe(); 32 | iframe.setAttribute("src", url); 33 | } 34 | } else { 35 | console.log("search engine no found !"); 36 | } 37 | }; 38 | 39 | let box = { ...utils, ...components, ...searchEngine, goToSearchPronounce }; 40 | export default box; 41 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/components.js: -------------------------------------------------------------------------------- 1 | import { prettyBox } from "./pretty-box.js"; 2 | import { hasClass, addClass, removeClass } from "./utils.js"; 3 | 4 | let styleConfig = () => { 5 | let css = document.createElement("link"); 6 | css.setAttribute("rel", "stylesheet"); 7 | css.setAttribute("type", "text/css"); 8 | css.setAttribute("href", chrome.runtime.getURL("css/app.css")); 9 | document.head.appendChild(css); 10 | }; 11 | 12 | let customElement = () => { 13 | let link = document.createElement("link"); 14 | link.setAttribute( 15 | "href", 16 | chrome.runtime.getURL("web-components/x-custom-box.html") 17 | ); 18 | document.head.appendChild(link); 19 | }; 20 | 21 | let getIframe = () => { 22 | let box = document.querySelector( 23 | "#chinese-programmer-wrong-pronunciation-custom-iframe-box" 24 | ); 25 | let iframe = null; 26 | if (!box) { 27 | let custom_box = document.createElement( 28 | "x-chinese-programmer-wrong-pronunciation-custom-box" 29 | ); 30 | 31 | let aside = document.createElement("aside"); 32 | aside.setAttribute( 33 | "id", 34 | "chinese-programmer-wrong-pronunciation-custom-iframe-box" 35 | ); 36 | aside.setAttribute( 37 | "class", 38 | "chinese-programmer-wrong-pronunciation-custom-iframe-box" 39 | ); 40 | aside.setAttribute("draggable", "true"); 41 | 42 | let tool_bar = document.createElement("div"); 43 | tool_bar.setAttribute( 44 | "class", 45 | "chinese-programmer-wrong-pronunciation-custom-tool-bar" 46 | ); 47 | tool_bar.addEventListener("click", (event) => { 48 | event.preventDefault(); 49 | event.stopPropagation(); 50 | }); 51 | 52 | let window_close_icon = document.createElement("span"); 53 | window_close_icon.innerText = "❌"; 54 | window_close_icon.setAttribute( 55 | "class", 56 | "chinese-programmer-wrong-pronunciation-custom-window-close-icon" 57 | ); 58 | window_close_icon.addEventListener("click", closeSearchWindow); 59 | tool_bar.appendChild(window_close_icon); 60 | 61 | iframe = document.createElement("iframe"); 62 | iframe.setAttribute( 63 | "id", 64 | "chinese-programmer-wrong-pronunciation-custom-iframe" 65 | ); 66 | iframe.setAttribute("security", "restricted"); 67 | //iframe.setAttribute('sandbox',"") 68 | 69 | aside.appendChild(tool_bar); 70 | aside.appendChild(iframe); 71 | custom_box.appendChild(aside); 72 | document.body.appendChild(custom_box); 73 | 74 | //设置 box 可 拖拽 75 | prettyBox(aside); 76 | //显示设置按键 77 | showSetSearchEngine(tool_bar, window_close_icon); 78 | } else { 79 | if ( 80 | hasClass( 81 | box, 82 | "chinese-programmer-wrong-pronunciation-custom-iframe-box-hidden" 83 | ) 84 | ) { 85 | removeClass( 86 | box, 87 | "chinese-programmer-wrong-pronunciation-custom-iframe-box-hidden" 88 | ); 89 | } 90 | iframe = box.querySelector( 91 | "#chinese-programmer-wrong-pronunciation-custom-iframe" 92 | ); 93 | iframe.setAttribute("src", "about:blank"); 94 | //iframe.contentDocument.close() 95 | box.removeChild(iframe); 96 | 97 | iframe = document.createElement("iframe"); 98 | iframe.setAttribute( 99 | "id", 100 | "chinese-programmer-wrong-pronunciation-custom-iframe" 101 | ); 102 | iframe.setAttribute("security", "restricted"); 103 | box.appendChild(iframe); 104 | } 105 | 106 | return iframe; 107 | }; 108 | 109 | let opener_key = "how-to-pronounce-from-search-engine-open-tab-opener"; 110 | let getSearchEngineOpener = () => { 111 | return JSON.parse(sessionStorage.getItem(opener_key)); 112 | }; 113 | 114 | let showSetSearchEngine = (box, window_close_icon) => { 115 | let opener = getSearchEngineOpener(); 116 | 117 | { 118 | let search_engin_provider = { 119 | goToYouDaoSearch: "有道", 120 | goToGoogleSearch: "谷歌", 121 | goToBingDictSearch: "必应词典", 122 | goToBingSearch: "必应", 123 | }; 124 | let select = document.createElement("select"); 125 | select.setAttribute("name", "search_engin_provider"); 126 | select.setAttribute("class", "search_engin_provider"); 127 | let htmlContent = ""; 128 | for (let i in search_engin_provider) { 129 | let selected = ""; 130 | if (opener && opener.search_engine_name) { 131 | selected = i === opener.search_engine_name ? 'selected="selected"' : ""; 132 | } 133 | htmlContent += ``; 134 | } 135 | 136 | select.innerHTML = htmlContent; 137 | 138 | select.addEventListener("click", setSearchEngine); 139 | box.insertBefore(select, window_close_icon); 140 | } 141 | { 142 | let search_engin_provider_tab = { 143 | current_tab: "当前标签展示结果", 144 | new_tab: "新标签展示结果", 145 | }; 146 | let select = document.createElement("select"); 147 | select.setAttribute("class", "search_engin_provider_tab"); 148 | select.setAttribute("name", "search_engin_provider_tab"); 149 | let htmlContent = ""; 150 | for (let i in search_engin_provider_tab) { 151 | let selected = ""; 152 | if (opener && opener.tab) { 153 | selected = i === opener.tab ? 'selected="selected"' : ""; 154 | } 155 | htmlContent += ``; 156 | } 157 | 158 | select.innerHTML = htmlContent; 159 | 160 | select.addEventListener("click", setSearchEngineOpener); 161 | box.insertBefore(select, window_close_icon); 162 | } 163 | 164 | let div = document.createElement("span"); 165 | div.setAttribute( 166 | "class", 167 | "chinese-programmer-wrong-pronunciation-custom-tool-bar-setup" 168 | ); 169 | div.innerText = `⚙`; 170 | // box.insertBefore(div,select) 171 | }; 172 | 173 | //关闭窗口 174 | let closeSearchWindow = () => { 175 | let box = document.querySelector( 176 | "#chinese-programmer-wrong-pronunciation-custom-iframe-box" 177 | ); 178 | console.log(box); 179 | if ( 180 | box && 181 | !hasClass( 182 | box, 183 | "chinese-programmer-wrong-pronunciation-custom-iframe-box-hidden" 184 | ) 185 | ) { 186 | addClass( 187 | box, 188 | "chinese-programmer-wrong-pronunciation-custom-iframe-box-hidden" 189 | ); 190 | } 191 | let iframe = box.querySelector( 192 | "#chinese-programmer-wrong-pronunciation-custom-iframe" 193 | ); 194 | iframe.setAttribute("src", "about:blank"); 195 | }; 196 | 197 | let setSearchEngine = (event) => { 198 | event.preventDefault(); 199 | event.stopPropagation(); 200 | console.log(event.target.value); 201 | setupConfig(event.target.value, null); 202 | }; 203 | let setSearchEngineOpener = (event) => { 204 | event.preventDefault(); 205 | event.stopPropagation(); 206 | console.log(event.target.value); 207 | 208 | setupConfig(null, event.target.value); 209 | }; 210 | 211 | let setupConfig = (search_engine_name, tab) => { 212 | let opener = getSearchEngineOpener(); 213 | //页面展示方式,默认有效期一天 214 | let expired_date = new Date().getTime() + 24 * 60 * 60 * 1000; 215 | if (opener) { 216 | if (search_engine_name) { 217 | opener.search_engine_name = search_engine_name; 218 | } 219 | if (tab) { 220 | opener.tab = tab; 221 | } 222 | } else { 223 | tab = "current_tab"; 224 | search_engine_name = "goToYouDaoSearch"; 225 | opener = { 226 | tab: tab, 227 | expired_date: expired_date, 228 | search_engine_name: search_engine_name, 229 | }; 230 | } 231 | 232 | sessionStorage.setItem(opener_key, JSON.stringify(opener)); 233 | }; 234 | let showResetCurrentSearchEngineTab = () => { 235 | let div = document.createElement("div"); 236 | div.setAttribute( 237 | "id", 238 | "#chinese-programmer-wrong-pronunciation-custom-tools-bar" 239 | ); 240 | div.innerHTML = ` 241 | 关闭搜索页面🥳🥳🥳🥳🥳🥳更换搜索引擎 242 | `; 243 | 244 | document 245 | .querySelector("#chinese-programmer-wrong-pronunciation-custom-iframe-box") 246 | .appendChild(div); 247 | }; 248 | 249 | let cleanOpener = () => { 250 | sessionStorage.removeItem(opener_key); 251 | console.log("恢复扩展默认配置---ok"); 252 | }; 253 | 254 | export { 255 | styleConfig, 256 | customElement, 257 | getIframe, 258 | getSearchEngineOpener, 259 | setSearchEngineOpener, 260 | cleanOpener, 261 | }; 262 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/init.js: -------------------------------------------------------------------------------- 1 | import box from "./box.js"; 2 | 3 | let init = () => { 4 | let URLObj = new URL(location.href); 5 | console.log(URLObj); 6 | if (document.querySelector("#readme table tbody")) { 7 | //载入自定义组件样式 8 | box.styleConfig(); 9 | //载入自定义组件 10 | box.customElement(); 11 | 12 | let audio_player = new Audio(); 13 | audio_player.setAttribute("autoplay", "true"); 14 | document 15 | .querySelector("#readme table tbody") 16 | .addEventListener("click", (event) => { 17 | //console.log(event.target) 18 | // console.log(event.target.nodeType) 19 | // console.log(event.target.nodeName); 20 | let parentElement = event.target.parentElement; 21 | if (parentElement && parentElement.nodeName === "TR") { 22 | if (parentElement.firstElementChild === event.target) { 23 | //使用搜索引擎查询发音 24 | box.goToSearchPronounce(event.target.innerText); 25 | } 26 | } 27 | event.preventDefault(); 28 | event.stopPropagation(); 29 | let audio_url = null; 30 | if (event.target.nodeName === "TD") { 31 | let aTag = event.target.querySelector("a"); 32 | if (aTag) { 33 | audio_url = aTag.getAttribute("href"); 34 | } 35 | } 36 | if (event.target.nodeName === "IMG") { 37 | let aTag = event.target.parentNode.parentNode; 38 | audio_url = aTag.getAttribute("href"); 39 | } 40 | if (event.target.nodeName === "G-EMOJI") { 41 | let aTag = event.target.parentNode; 42 | audio_url = aTag.getAttribute("href"); 43 | } 44 | if (audio_url) { 45 | let desURL = new URL(audio_url); 46 | //console.log(desURL.protocol); 47 | if (desURL.protocol === "http:") { 48 | //skip http 49 | location.href = audio_url; 50 | } else { 51 | // console.log("audio_url:", audio_url); 52 | audio_player.setAttribute("src", audio_url); 53 | } 54 | } 55 | }); 56 | document 57 | .querySelector("#readme table tbody") 58 | .addEventListener("mouseover", (event) => { 59 | let parentElement = event.target.parentElement; 60 | if (parentElement && parentElement.nodeName === "TR") { 61 | if (parentElement.firstElementChild === event.target) { 62 | event.target.setAttribute("title", "点击我打开搜索引擎检索"); 63 | event.target.style.cursor = "pointer"; 64 | } 65 | } 66 | }); 67 | 68 | let table = document.querySelector("#readme table"); 69 | let parent = table.parentNode; 70 | let note = document.createElement("span"); 71 | note.innerText = `⚪恢复扩展默认配置⚪`; 72 | note.setAttribute( 73 | "class", 74 | "chinese-programmer-wrong-pronunciation-custom-note-reset" 75 | ); 76 | 77 | note.addEventListener("click", (event) => { 78 | //重置配置 79 | event.preventDefault(); 80 | event.stopPropagation(); 81 | box.cleanOpener(); 82 | }); 83 | parent.insertBefore(note, table); 84 | } else { 85 | console.log("no found README.md table"); 86 | } 87 | }; 88 | 89 | export { init }; 90 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/pretty-box.js: -------------------------------------------------------------------------------- 1 | import { addClass, removeClass } from "./utils.js"; 2 | 3 | let prettyBox = (box) => { 4 | // 参考 https://blog.csdn.net/weixin_41910848/article/details/82218243 5 | 6 | let dragging = false; 7 | let diffX = null; 8 | let diffY = null; 9 | box.onmousedown = function (event) { 10 | dragging = true; 11 | 12 | let left = box.offsetLeft; 13 | let top = box.offsetTop; 14 | 15 | removeClass( 16 | box, 17 | "chinese-programmer-wrong-pronunciation-custom-iframe-box" 18 | ); 19 | 20 | box.style.left = left + "px"; 21 | box.style.top = top + "px"; 22 | 23 | diffX = event.clientX - left; 24 | diffY = event.clientY - top; 25 | }; 26 | document.onmousemove = function (event) { 27 | if (dragging) { 28 | // console.log(event.clientX, event.clientY) 29 | //console.log(diffX, diffY) 30 | 31 | let moveX = event.clientX - diffX; 32 | let moveY = event.clientY - diffY; 33 | 34 | if (moveX < 0) { 35 | moveX = 0; 36 | } else if (moveX > window.innerWidth - box.offsetWidth) { 37 | moveX = window.innerWidth - box.offsetWidth; 38 | } 39 | if (moveY < 0) { 40 | moveY = 0; 41 | } else if (moveY > window.innerHeight - box.offsetHeight) { 42 | moveY = window.innerHeight - box.offsetHeight; 43 | } 44 | 45 | box.style.left = moveX + "px"; 46 | box.style.top = moveY + "px"; 47 | 48 | event.stopPropagation(); 49 | event.preventDefault(); 50 | } 51 | }; 52 | document.onmouseup = function (event) { 53 | dragging = false; 54 | }; 55 | 56 | box.onmouseup = (event) => { 57 | dragging = false; 58 | }; 59 | 60 | box.ondragstart = function (event) { 61 | console.log(box.offsetLeft, box.offsetTop); 62 | console.log("开始拖拽"); 63 | }; 64 | box.ondrag = function () { 65 | console.log(box.offsetLeft, box.offsetTop); 66 | console.log("拖拽中"); 67 | }; 68 | box.ondragend = function () { 69 | console.log(box.offsetLeft, box.offsetTop); 70 | console.log("拖拽结束"); 71 | }; 72 | }; 73 | 74 | export { prettyBox }; 75 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/search-engine.js: -------------------------------------------------------------------------------- 1 | let goToGoogleSearch = (word) => { 2 | word = word.replace(/\s/, "+"); 3 | return `https://www.google.com/search?q=how+to+pronounce+${word}`; 4 | }; 5 | 6 | let goToYouDaoSearch = (word) => { 7 | word = word.replace(/\s/, "+"); 8 | return `https://www.youdao.com/result?word=${word}&lang=en`; 9 | }; 10 | 11 | let goToBingDictSearch = (word) => { 12 | return `https://cn.bing.com/dict/${word}`; 13 | }; 14 | let goToBingSearch = (word) => { 15 | return `https://cn.bing.com/search?q=how%20to%20pronounce%20${word}`; 16 | }; 17 | 18 | export { 19 | goToYouDaoSearch, 20 | goToGoogleSearch, 21 | goToBingDictSearch, 22 | goToBingSearch, 23 | }; 24 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/app/utils.js: -------------------------------------------------------------------------------- 1 | function hasClass(el, className) { 2 | if (el.classList) return el.classList.contains(className); 3 | return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); 4 | } 5 | 6 | function addClass(el, className) { 7 | if (el.classList) el.classList.add(className); 8 | else if (!hasClass(el, className)) el.className += " " + className; 9 | } 10 | 11 | function removeClass(el, className) { 12 | if (el.classList) el.classList.remove(className); 13 | else if (hasClass(el, className)) { 14 | let reg = new RegExp("(\\s|^)" + className + "(\\s|$)"); 15 | el.className = el.className.replace(reg, " "); 16 | } 17 | } 18 | 19 | function getCookie(name) { 20 | let arr, 21 | reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); 22 | if ((arr = document.cookie.match(reg))) { 23 | return decodeURIComponent(arr[2]); 24 | } else { 25 | return null; 26 | } 27 | //await cookieStore.get({name:name}) 28 | } 29 | 30 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie 31 | 32 | function setCookie(name, value, second, path, domain) { 33 | var exp = new Date(); 34 | exp.setTime(exp.getTime() + second * 1000); 35 | document.cookie = 36 | name + 37 | "=" + 38 | encodeURIComponent(value) + 39 | ";expires=" + 40 | exp.toGMTString() + 41 | ";path=" + 42 | path + 43 | ";domain=" + 44 | domain + 45 | ";SameSite=None;Secure"; 46 | } 47 | async function getCookies(domain) { 48 | let cookies = await cookieStore.getAll({ domain: domain }); 49 | return cookies; 50 | } 51 | 52 | function encodeBase64(str) { 53 | return btoa(encodeURIComponent(str)); 54 | } 55 | 56 | function decodeBase64(encoded) { 57 | return decodeURIComponent(atob(encoded)); 58 | } 59 | 60 | function getParameterValue(name) { 61 | let reg = new RegExp("[^?&]?" + encodeURI(name) + "=[^&]+"); 62 | let arr = location.search.match(reg); 63 | if (arr != null) { 64 | return decodeURI(arr[0].substring(arr[0].search("=") + 1)); 65 | } 66 | return ""; 67 | } 68 | 69 | function createJSONFile(content, filename) { 70 | let blob = new Blob([JSON.stringify(content)], { type: "application/json" }); 71 | let url = window.URL.createObjectURL(blob); 72 | let a = document.createElement("a"); 73 | a.style.display = "none"; 74 | a.href = url; 75 | a.download = filename; 76 | a.click(); 77 | setTimeout(function () { 78 | window.URL.revokeObjectURL(url); 79 | }, 3000); 80 | } 81 | 82 | async function sleep(time) { 83 | return new Promise((resolve) => setTimeout(resolve, time)); 84 | } 85 | 86 | async function getMediaDevices() { 87 | return await navigator.mediaDevices.enumerateDevices(); 88 | } 89 | 90 | // new URLSearchParams 91 | // new URL 92 | // (new Date()).toISOString() 93 | export { 94 | addClass, 95 | removeClass, 96 | hasClass, 97 | setCookie, 98 | getCookie, 99 | encodeBase64, 100 | decodeBase64, 101 | getParameterValue, 102 | sleep, 103 | getMediaDevices, 104 | createJSONFile, 105 | }; 106 | -------------------------------------------------------------------------------- /tools/chromium_extension/js/content-script.js: -------------------------------------------------------------------------------- 1 | (async () => { 2 | let app = await import(chrome.runtime.getURL("js/app/init.js")); 3 | app.init(); 4 | })(); 5 | -------------------------------------------------------------------------------- /tools/chromium_extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chinese-programmer-wrong-pronunciation-chromium-extension", 3 | "version": "0.1.0", 4 | "manifest_version": 3, 5 | "description": "页面无跳转 听正确读音", 6 | "content_scripts": [ 7 | { 8 | "matches": [ 9 | "*://*/shimohq/chinese-programmer-wrong-pronunciation/*", 10 | "*://*/jingjingxyk/chinese-programmer-wrong-pronunciation/*" 11 | ], 12 | "run_at": "document_idle", 13 | "js": ["js/content-script.js"] 14 | } 15 | ], 16 | "permissions": [ 17 | "declarativeNetRequest", 18 | "declarativeNetRequestWithHostAccess" 19 | ], 20 | "host_permissions": [ 21 | "*://github.com/*", 22 | "*://www.google.com/*", 23 | "*://cn.bing.com/*", 24 | "*://www.bing.com/*", 25 | "*://www.youdao.com/*", 26 | "*://dict.youdao.com/*" 27 | ], 28 | "web_accessible_resources": [ 29 | { 30 | "resources": ["*.js", "*.css", "*.html"], 31 | "matches": ["*://*/*"], 32 | "extension_ids": [], 33 | "use_dynamic_url": true 34 | } 35 | ], 36 | "declarative_net_request": { 37 | "rule_resources": [ 38 | { 39 | "id": "remove_content_security_policy", 40 | "enabled": true, 41 | "path": "rules/remove_content_security_policy.json" 42 | } 43 | ] 44 | }, 45 | "author": "https://github.com/jingjingxyk", 46 | "homepage_url": "https://github.com/shimohq/chinese-programmer-wrong-pronunciation.git" 47 | } 48 | -------------------------------------------------------------------------------- /tools/chromium_extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chinese-programmer-wrong-pronunciation-chromium-extension", 3 | "version": "1.0.0", 4 | "description": "README.md 页面无跳转 即可听正确读音", 5 | "main": "index.js", 6 | "scripts": { 7 | "format-code": "npx prettier --write . && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "prettier": "2.6.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/chromium_extension/rules/remove_content_security_policy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "priority": 99, 5 | "action": { 6 | "type": "modifyHeaders", 7 | "responseHeaders": [ 8 | { "header": "content-security-policy", "operation": "remove" }, 9 | { 10 | "header": "content-security-policy-report-only", 11 | "operation": "remove" 12 | }, 13 | { "header": "expect-ct", "operation": "remove" }, 14 | { "header": "report-to", "operation": "remove" }, 15 | { "header": "x-content-security-policy", "operation": "remove" }, 16 | { "header": "x-webkit-csp", "operation": "remove" }, 17 | { "header": "x-xss-protection", "operation": "remove" }, 18 | { 19 | "header": "x-permitted-cross-domain-policies", 20 | "operation": "remove" 21 | }, 22 | { "header": "x-content-type-options", "operation": "remove" }, 23 | { "header": "x-frame-options", "operation": "remove" }, 24 | { "header": "X-Frame-Options", "operation": "remove" }, 25 | { "header": "permissions-policy", "operation": "remove" }, 26 | { "header": "timing-allow-origin", "operation": "remove" }, 27 | { "header": "cross-origin-embedder-policy", "operation": "remove" }, 28 | { "header": "cross-origin-opener-policy", "operation": "remove" }, 29 | { 30 | "header": "cross-origin-opener-policy-report-only", 31 | "operation": "remove" 32 | }, 33 | { 34 | "header": "cross-origin-embedder-policy-report-only", 35 | "operation": "remove" 36 | } 37 | ] 38 | }, 39 | "condition": { 40 | "urlFilter": "*", 41 | "requestDomains": [ 42 | "github.com", 43 | "githubusercontent.com", 44 | "www.google.com", 45 | "cn.bing.com", 46 | "www.bing.com", 47 | "fanyi.baidu.com", 48 | "www.youdao.com", 49 | "dict.youdao.com" 50 | ], 51 | "resourceTypes": [ 52 | "main_frame", 53 | "sub_frame", 54 | "stylesheet", 55 | "script", 56 | "image", 57 | "font", 58 | "object", 59 | "xmlhttprequest", 60 | "ping", 61 | "csp_report", 62 | "media", 63 | "websocket", 64 | "webtransport", 65 | "webbundle", 66 | "other" 67 | ] 68 | } 69 | } 70 | ] 71 | -------------------------------------------------------------------------------- /tools/chromium_extension/web-components/README.md: -------------------------------------------------------------------------------- 1 | # HTML Imports,HTML Template、Shadow DOM----统称为 Web Components 规范 2 | 3 | ## Shadow DOM 实现代码隔离 4 | -------------------------------------------------------------------------------- /tools/chromium_extension/web-components/x-custom-box.html: -------------------------------------------------------------------------------- 1 | 2 |
自定义web组件-做代码隔离
3 |
4 | --------------------------------------------------------------------------------