id: 5bc3b9b7ac1c4864814fca038d05a150
parent_id: 
item_type: 1
item_id: 1d06090f219444c39c5cbd55f5401e26
item_updated_time: 1764345496213
title_diff: "[{\"diffs\":[[1,\"配置文件预处理  Clash for Windows\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":26}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>配置文件预处理 | Clash for Windows</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"24812\\\"></a>\\\r\\\n<h1>配置文件预处理 | Clash for Windows</h1>\\\r\\\n\\\r\\\n<div><span>\\\n  <div style=\\\"--en-clipped-content:article; --en-clipped-source-url:https://docs.cfw.lbyczf.com/contents/parser.html#%25E7%2589%2588%25E6%259C%25AC%25E8%25A6%2581%25E6%25B1%2582; --en-clipped-source-title:配置文件预处理 | Clash for Windows;\\\">\\\n<div><br/></div><div style=\\\"min-height: 5692px; font-size: 16px; display:block; min-width: 100%; position: relative;\\\"> <div style=\\\"background-color:rgb(255, 255, 255);scroll-behavior:smooth;\\\"><div style=\\\"background-color:rgb(255, 255, 255);font-family:-apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, Cantarell, &quot;Fira Sans&quot;, &quot;Droid Sans&quot;, &quot;Helvetica Neue&quot;, sans-serif;-webkit-font-smoothing:antialiased;font-size:16px;color:rgb(44, 62, 80);\\\"><div><div><span><div><h1 style=\\\"font-weight:600;line-height:1.25;font-size:35.2px;padding-top:73.6px;margin-top:-1.5rem;margin-bottom:16px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E9%A2%84%E5%A4%84%E7%90%86\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 配置文件预处理</h1> <h2 style=\\\"font-weight:600;line-height:1.25;font-size:26.4px;padding-bottom:4.8px;border-bottom:1px solid rgb(234, 236, 239);margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 版本要求</h2> <p style=\\\"line-height:1.7;\\\">0.10.1 版本更新后，支持使用 JavaScript 对下载后的配置文件进行预处理</p> <p style=\\\"line-height:1.7;\\\">0.11.10 版本更新后，支持使用 YAML 对下载后配置文件进行简单预处理</p> <h2 style=\\\"font-weight:600;line-height:1.25;font-size:26.4px;padding-bottom:4.8px;border-bottom:1px solid rgb(234, 236, 239);margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E7%AE%80%E4%BE%BF%E6%96%B9%E6%B3%95-yaml\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 简便方法（YAML）</h2> <p style=\\\"line-height:1.7;\\\">如果需要对下载地址为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">https://example.com/profile.yaml</code>的配置文件进行预处理，操作如下：</p> <ol style=\\\"padding-left:1.2em;line-height:1.7;\\\"><li>进入 Settings 界面</li> <li>滚动至 Profiles 栏</li> <li>点击 Parsers 右边 Edit 打开编辑器，填入：<div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">parsers</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">url</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//example.com/profile.yaml\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">yaml</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">prepend-rules</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n        <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> DOMAIN<span style=\\\"color:rgb(204, 204, 204);\\\">,</span>test.com<span style=\\\"color:rgb(204, 204, 204);\\\">,</span>DIRECT <span style=\\\"color:rgb(153, 153, 153);\\\"># rules最前面增加一个规则</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">append-proxies</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n        <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">name</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> test <span style=\\\"color:rgb(153, 153, 153);\\\"># proxies最后面增加一个服务</span>\\\n          <span style=\\\"color:rgb(204, 153, 205);\\\">type</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> http\\\n          <span style=\\\"color:rgb(204, 153, 205);\\\">server</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> 123.123.123.123\\\n          <span style=\\\"color:rgb(204, 153, 205);\\\">port</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(240, 141, 73);\\\">456</span>\\\n</code></pre></div></li> <li>点击编辑器右下角保存按钮</li></ol> <p style=\\\"line-height:1.7;\\\">当配置文件触发刷新（包括自动更新）时，CFW 会读取<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">yaml</code>字段定义的值，将对应值插入/合并到原配置文件中</p> <h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 参数说明</h3> <table style=\\\"font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;border-collapse:collapse;margin:1rem 0px;display:block;overflow-x:auto;\\\"><thead><tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><th style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">键</th> <th style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">值类型</th> <th style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">操作</th></tr></thead> <tbody><tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">append-rules</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">rules</code>数组<strong style=\\\"font-weight:600;\\\">后</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);background-color:rgb(246, 248, 250);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">prepend-rules</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">rules</code>数组<strong style=\\\"font-weight:600;\\\">前</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">append-proxies</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>数组<strong style=\\\"font-weight:600;\\\">后</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);background-color:rgb(246, 248, 250);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">prepend-proxies</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>数组<strong style=\\\"font-weight:600;\\\">前</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">append-proxy-groups</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxy-groups</code>数组<strong style=\\\"font-weight:600;\\\">后</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);background-color:rgb(246, 248, 250);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">prepend-proxy-groups</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxy-groups</code>数组<strong style=\\\"font-weight:600;\\\">前</strong></td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">mix-proxy-providers</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxy-providers</code>中</td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);background-color:rgb(246, 248, 250);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">mix-rule-providers</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象合并至原配置<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">rule-providers</code>中</td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">mix-object</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">对象合并至原配置最外层中</td></tr> <tr style=\\\"border-top:1px solid rgb(223, 226, 229);background-color:rgb(246, 248, 250);\\\"><td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">commands</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">数组</td> <td style=\\\"border:1px solid rgb(223, 226, 229);padding:0.6em 1em;\\\">在上面操作完成后执行简单命令操作配置文件</td></tr></tbody></table> <h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#commands-%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95-beta\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> Commands 使用方法（beta）</h3> <p style=\\\"line-height:1.7;\\\">commands 是一组简单的命令，作为上面操作的补充</p> <p style=\\\"line-height:1.7;\\\">例子:</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">commands</span></span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> dns.enable=false <span style=\\\"color:rgb(153, 153, 153);\\\"># 命令1</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> proxy<span style=\\\"color:rgb(204, 204, 204);\\\">-</span>groups.0.proxies.2+DIRECT <span style=\\\"color:rgb(153, 153, 153);\\\"># 命令2</span>\\\n</code></pre></div><p style=\\\"line-height:1.7;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">每个命令可以被分为三个部分，分别是：</span><strong style=\\\"font-weight:600;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">定位+操作+设定值</span></strong></p> <p style=\\\"line-height:1.7;\\\">命令 1 中，定位是<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">dns.enable</code>，操作是<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">=</code>，设定值是<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">false</code></p> <p style=\\\"line-height:1.7;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">命令 2 中，定位是</span><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">proxy-groups.0.proxies.2</span></code><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">，操作是</span><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">+</span></code><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">，设</span><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">定值是</span><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\"><span style=\\\"background-color:rgb(234, 226, 96);transition:background-color 0.4s ease 0s;color:black;font-style:inherit;font-weight:inherit;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">DIRECT</span></code></p> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%AE%9A%E4%BD%8D\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 定位</h4> <p style=\\\"line-height:1.7;\\\">定位中每个层级以<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">.</code>分割，数组类型的定位下标由 0 开始计算，命令 2 中<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxy-groups.0</code>即表示定位至第 1 个策略组，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">.proxies</code>表示访问第一个策略组的 proxies 属性，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">.proxies.2</code>表示 proxies 属性的第 3 个位置</p> <p style=\\\"line-height:1.7;\\\">如果不想用序号定位，也可以使用<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">name</code>值定位，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>以及<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxy-groups</code>中的每个项目都会有<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">name</code>属性。例如在<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>中已经定义了名为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">debug</code>的节点，那么修改其<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">udp</code>参数的定位即为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies.(debug).udp</code>，名称两边的<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">()</code>是保证识别，如果节点名不包括<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">+</code>、<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">.</code>或<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">=</code>这几个符号，也可以省略不写</p> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E6%93%8D%E4%BD%9C\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 操作</h4> <p style=\\\"line-height:1.7;\\\">目前支持三种操作：</p> <ul style=\\\"padding-left:1.2em;line-height:1.7;\\\"><li><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">=</code>：覆盖</li> <li><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">+</code>：插入</li> <li><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">-</code>：删除</li></ul> <p style=\\\"line-height:1.7;\\\">命令 1 中，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">=</code>表示将<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">dns</code>下<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">enable</code>的值覆盖为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">false</code></p> <p style=\\\"line-height:1.7;\\\">命令 2 中，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">+</code>表示在定位的策略组中的<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>数组中添加一个名为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">DIRECT</code>的值，原本其他值被向后移动 1 位。如果此处改成<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">=</code>，则会覆盖原来第一个值</p> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E8%AE%BE%E5%AE%9A%E5%80%BC\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 设定值</h4> <p style=\\\"line-height:1.7;\\\">设定值是用于插入或覆盖的值，如果操作是<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">-</code>，则此值可有可无，例如：</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">commands</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> proxies.0<span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(153, 153, 153);\\\"># 命令3</span>\\\n</code></pre></div><p style=\\\"line-height:1.7;\\\">此处可以将配置文件<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">proxies</code>的第 1 个节点删除</p> <p style=\\\"line-height:1.7;\\\">如果设定值为纯数字，则会被识别为整数，为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">true|false</code>则识别为布尔类型，如果 JSON 编码通过则识别为对象</p> <p style=\\\"line-height:1.7;\\\">v0.13.7 版本更新后，支持 3 个内置值用于设置策略组节点，分别是<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">[]proxyNames</code>，<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">[]groupNames</code>和<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">[]shuffledProxyNames</code>，并支持使用正则过滤其中节点，例子如下：</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">yaml</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 153, 205);\\\">prepend-proxy-groups</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n    <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">name</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> myGroup <span style=\\\"color:rgb(153, 153, 153);\\\"># 建立新策略组</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">type</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> fallback\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">url</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(126, 198, 153);\\\">&quot;http://www.gstatic.com/generate_204&quot;</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">interval</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(240, 141, 73);\\\">300</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">proxies</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n        <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> DIRECT\\\n\\\n  <span style=\\\"color:rgb(204, 153, 205);\\\">commands</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n    <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> proxy<span style=\\\"color:rgb(204, 204, 204);\\\">-</span>groups.myGroup.proxies=<span style=\\\"color:rgb(204, 204, 204);\\\">[</span><span style=\\\"color:rgb(204, 204, 204);\\\">]</span>proxyNames<span style=\\\"color:rgb(204, 204, 204);\\\">|</span>HK <span style=\\\"color:rgb(153, 153, 153);\\\"># 向策略组添加所有定义的节点名，并按“HK”正则表达式过滤</span>\\\n</code></pre></div><h2 style=\\\"font-weight:600;line-height:1.25;font-size:26.4px;padding-bottom:4.8px;border-bottom:1px solid rgb(234, 236, 239);margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E8%BF%9B%E9%98%B6%E6%96%B9%E6%B3%95-javascript\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 进阶方法（JavaScript）</h2> <p style=\\\"line-height:1.7;\\\">如果需要对下载地址为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">https://example.com/profile.yaml</code>的配置文件进行预处理，操作如下：</p> <ol style=\\\"padding-left:1.2em;line-height:1.7;\\\"><li>进入 Settings 界面</li> <li>滚动至 Profiles 栏</li> <li>点击 Parsers 右边 Edit 打开编辑器，填入：<div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">parsers</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">url</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//example.com/profile.yaml\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">code</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(204, 204, 204);\\\">|</span><span style=\\\"color:rgb(126, 198, 153);\\\">\\\n      module.exports.parse = async (raw, { axios, yaml, notify, console }, { name, url, interval, selected }) =&gt; {\\\n        const obj = yaml.parse(raw)\\\n        return yaml.stringify(obj)\\\n      }</span>\\\n</code></pre></div></li> <li>点击编辑器右下角保存按钮</li></ol> <p style=\\\"line-height:1.7;\\\">当配置文件触发刷新（包括自动更新）时，CFW 会调用此方法对下载的配置文件内容进行处理，再写入本地文件中</p> <p style=\\\"line-height:1.7;\\\">当然，parsers 也支持使用路径引入代码：</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">parsers</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">url</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//example.com/profile.yaml\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">file</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(126, 198, 153);\\\">&quot;C:/Users/cfw/parser.js&quot;</span>\\\n</code></pre></div><h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-2\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 参数说明</h3> <p style=\\\"line-height:1.7;\\\">CFW 调用用户定义的<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">parse</code>方法时，会传入 3 个参数，分别是<strong style=\\\"font-weight:600;\\\">配置文件文本内容</strong>，<strong style=\\\"font-weight:600;\\\">工具类对象/方法</strong>以及<strong style=\\\"font-weight:600;\\\">配置文件元数据</strong></p> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%96%87%E6%9C%AC%E5%86%85%E5%AE%B9\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 配置文件文本内容</h4> <p style=\\\"line-height:1.7;\\\">raw 是一个字符串，一般需要用 yaml 库解析成 JavaScript 对象</p> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%B7%A5%E5%85%B7%E7%B1%BB%E5%AF%B9%E8%B1%A1-%E6%96%B9%E6%B3%95\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 工具类对象/方法</h4> <p style=\\\"line-height:1.7;\\\">包括：</p> <ul style=\\\"padding-left:1.2em;line-height:1.7;\\\"><li>axios：网络请求框架，<a href=\\\"https://github.com/axios/axios\\\" rel=\\\"noopener noreferrer\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);\\\" target=\\\"_blank\\\">GitHub<span><img src=\\\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' x='0px' y='0px' viewBox='0 0 100 100' width='15' height='15' class='icon outbound js-evernote-checked' data-evernote-id='390'%3e%3cpath fill='currentColor' d='M18.8%2c85.1h56l0%2c0c2.2%2c0%2c4-1.8%2c4-4v-32h-8v28h-48v-48h28v-8h-32l0%2c0c-2.2%2c0-4%2c1.8-4%2c4v56C14.8%2c83.3%2c16.6%2c85.1%2c18.8%2c85.1z'%3e%3c/path%3e %3cpolygon fill='currentColor' points='45.7%2c48.7 51.3%2c54.3 77.2%2c28.5 77.2%2c37.2 85.2%2c37.2 85.2%2c14.9 62.8%2c14.9 62.8%2c22.9 71.5%2c22.9'%3e%3c/polygon%3e%3c/svg%3e\\\" style=\\\"color:rgb(170, 170, 170);display:inline-block;vertical-align:middle;position:relative;top:-1px;\\\"></img> <span style=\\\"position:absolute;width:1px;height:1px;padding:0px;margin:-1px;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);white-space:nowrap;border-width:0px;\\\">(opens new window)</span></span></a></li> <li>yaml：yaml 框架，<a href=\\\"https://github.com/eemeli/yaml\\\" rel=\\\"noopener noreferrer\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);\\\" target=\\\"_blank\\\">GitHub<span><img src=\\\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' x='0px' y='0px' viewBox='0 0 100 100' width='15' height='15' class='icon outbound js-evernote-checked' data-evernote-id='391'%3e%3cpath fill='currentColor' d='M18.8%2c85.1h56l0%2c0c2.2%2c0%2c4-1.8%2c4-4v-32h-8v28h-48v-48h28v-8h-32l0%2c0c-2.2%2c0-4%2c1.8-4%2c4v56C14.8%2c83.3%2c16.6%2c85.1%2c18.8%2c85.1z'%3e%3c/path%3e %3cpolygon fill='currentColor' points='45.7%2c48.7 51.3%2c54.3 77.2%2c28.5 77.2%2c37.2 85.2%2c37.2 85.2%2c14.9 62.8%2c14.9 62.8%2c22.9 71.5%2c22.9'%3e%3c/polygon%3e%3c/svg%3e\\\" style=\\\"color:rgb(170, 170, 170);display:inline-block;vertical-align:middle;position:relative;top:-1px;\\\"></img> <span style=\\\"position:absolute;width:1px;height:1px;padding:0px;margin:-1px;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);white-space:nowrap;border-width:0px;\\\">(opens new window)</span></span></a></li> <li>notify：发出系统通知方法，签名为<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">function notify(title:string, message:string, silent:bool)</code></li> <li>console：日志输出至文件，方便调试，在 Settings 界面中 Parser 设置下方打开</li> <li>homeDir：Home Directory 目录</li></ul> <div style=\\\"padding:0.1rem 1.5rem;border-left-width:7.99716px;border-left-style:solid;margin:1rem 0px;background-color:rgb(243, 245, 247);border-color:rgb(66, 185, 131);\\\"><p style=\\\"line-height:1.7;font-weight:600;margin-bottom:-0.4rem;\\\">TIP</p> <p style=\\\"line-height:1.7;\\\">除了以上工具类，在使用<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">.js</code>文件时，也可以通过<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">npm</code>引入第三方模块</p></div> <h4 style=\\\"font-weight:600;line-height:1.25;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%85%83%E6%95%B0%E6%8D%AE\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 配置文件元数据</h4> <p style=\\\"line-height:1.7;\\\">元数据为 JavaScript 对象，包括：</p> <ul style=\\\"padding-left:1.2em;line-height:1.7;\\\"><li>name：名称</li> <li>url：下载地址</li> <li>interval：更新周期</li> <li>selected：策略组选择缓存，数组</li> <li>mode：模式缓存</li></ul> <div style=\\\"padding:0.1rem 1.5rem;border-left-width:7.99716px;border-left-style:solid;margin:1rem 0px;background-color:rgb(243, 245, 247);border-color:rgb(66, 185, 131);\\\"><p style=\\\"line-height:1.7;font-weight:600;margin-bottom:-0.4rem;\\\">TIP</p> <p style=\\\"line-height:1.7;\\\">元数据在配置文件首次下载时为空对象</p></div> <h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E8%BF%94%E5%9B%9E%E8%AF%B4%E6%98%8E\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 返回说明</h3> <p style=\\\"line-height:1.7;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">parse</code>方法需要返回一个字符串，CFW 会将返回的字符串存入对应的配置文件中</p> <h2 style=\\\"font-weight:600;line-height:1.25;font-size:26.4px;padding-bottom:4.8px;border-bottom:1px solid rgb(234, 236, 239);margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%A4%9A%E5%A4%84%E7%90%86%E5%99%A8%E5%8F%8A%E6%AD%A3%E5%88%99%E5%8C%B9%E9%85%8D\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 多处理器及正则匹配</h2> <h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E6%AD%A3%E5%88%99%E5%8C%B9%E9%85%8D\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 正则匹配</h3> <p style=\\\"line-height:1.7;\\\">上面例子中，使用<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">url</code>匹配配置文件地址，如果一个处理器需要处理多个配置文件，也可以使用正则表达式进行匹配，使用关键字<code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;color:rgb(71, 101, 130);padding:0.25rem 0.5rem;margin:0px;font-size:0.85em;background-color:rgba(27, 31, 35, 0.05);border-radius:3px;\\\">reg</code>设置</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">parsers</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">reg</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//test.com.+$ <span style=\\\"color:rgb(153, 153, 153);\\\"># 正则匹配域名</span>\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">yaml</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n      <span style=\\\"color:rgb(204, 153, 205);\\\">prepend-rules</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n        <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> DOMAIN<span style=\\\"color:rgb(204, 204, 204);\\\">,</span>test.com<span style=\\\"color:rgb(204, 204, 204);\\\">,</span>DIRECT\\\n</code></pre></div><h3 style=\\\"font-weight:600;line-height:1.25;font-size:21.6px;margin-top:-3.1rem;padding-top:73.6px;margin-bottom:0px;\\\"><a href=\\\"https://docs.cfw.lbyczf.com/contents/parser.html#%E5%A4%9A%E5%A4%84%E7%90%86%E5%99%A8\\\" style=\\\"font-weight:500;text-decoration:none;color:rgb(62, 175, 124);font-size:0.85em;float:left;margin-left:-0.87em;padding-right:0.23em;margin-top:0.125em;opacity:0;\\\">#</a> 多处理器</h3> <p style=\\\"line-height:1.7;\\\">parser 定义的数组支持多个处理器从上至下按顺序执行，例如：</p> <div style=\\\"position:relative;background-color:rgb(40, 44, 52);border-radius:6px;\\\"><span style=\\\"position:absolute;z-index:3;top:0.8em;right:1em;font-size:0.75rem;color:rgba(255, 255, 255, 0.4);\\\">yaml</span><pre style=\\\"color:rgb(204, 204, 204);font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;overflow-wrap:normal;tab-size:4;hyphens:none;border-radius:6px;line-height:1.4;padding:1.25rem 1.5rem;margin:0.85rem 0px;overflow:auto;position:relative;z-index:1;background:transparent;\\\"><code style=\\\"font-family:source-code-pro, Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace;margin:0px;font-size:0.85em;color:rgb(255, 255, 255);padding:0px;background-color:transparent;border-radius:0px;\\\"><span style=\\\"color:rgb(204, 153, 205);\\\">parsers</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">reg</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//test.com.+$ <span style=\\\"color:rgb(153, 153, 153);\\\"># 第一个执行的parser</span>\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">file</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(126, 198, 153);\\\">&quot;C:/Users/cfw/parser.yaml&quot;</span>\\\n  <span style=\\\"color:rgb(204, 204, 204);\\\">-</span> <span style=\\\"color:rgb(204, 153, 205);\\\">url</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> https<span style=\\\"color:rgb(204, 204, 204);\\\">:</span>//example.com/profile.yaml <span style=\\\"color:rgb(153, 153, 153);\\\"># 对上一个parser执行的结果进行处理</span>\\\n    <span style=\\\"color:rgb(204, 153, 205);\\\">file</span><span style=\\\"color:rgb(204, 204, 204);\\\">:</span> <span style=\\\"color:rgb(126, 198, 153);\\\">&quot;C:/Users/cfw/parser.js&quot;</span>\\\n</code></pre></div><div style=\\\"padding:0.1rem 1.5rem;border-left-width:7.99716px;border-left-style:solid;margin:1rem 0px;background-color:rgb(243, 245, 247);border-color:rgb(66, 185, 131);\\\"><p style=\\\"line-height:1.7;font-weight:600;margin-bottom:-0.4rem;\\\">TIP</p> <p style=\\\"line-height:1.7;\\\">file 同时支持 yaml 及 js 格式的文件</p></div></div></span></div></div></div></div></div>\\\n</div>\\\n</span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":48248}]"
metadata_diff: {"new":{"id":"1d06090f219444c39c5cbd55f5401e26","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345896288,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:20:28.110Z
created_time: 2025-11-28T16:20:28.110Z
type_: 13