Skip to content

Commit bd9cf4d

Browse files
committed
优化 [自定义翻页规则] 示例
1 parent d4cb4fd commit bd9cf4d

1 file changed

Lines changed: 43 additions & 30 deletions

File tree

Autopage.user.js

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7814,7 +7814,7 @@ function: {
78147814
let _html = `<div id="Autopage_customRules" style="left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important; width: 100% !important; height: 100% !important; margin: auto !important; padding: 25px 10px 10px 10px !important; position: fixed !important; opacity: 0.95 !important; z-index: 99999 !important; background-color: #eee !important; color: #222 !important; font-size: 14px !important; overflow: scroll !important; text-align: left !important;">
78157815
<h3><strong>自定义翻页规则(优先于脚本内置规则)-【把规则插入默认的 { } 中间】</strong></h3>
78167816
<details>
7817-
<summary><kbd><strong>「 点击展开 查看示例 」(把常用规则都放在一起了,方便需要的时候可复制一份修改使用)</strong></kbd></summary>
7817+
<summary><kbd><strong>「 点击展开 查看示例 」(我把常用规则都塞进去了,方便需要的时候可复制一份修改/删减后使用)</strong></kbd></summary>
78187818
<ul style="list-style: disc !important; margin-left: 35px !important;">
78197819
<li>翻页规则为 JSON 格式,因此大家需要先去<strong>了解一下 JSON 的基本格式</strong>。</li>
78207820
<li>具体的翻页规则说明、示例,为了方便更新及补充,我都写到 <strong><a href="https://github.com/XIU2/UserScript/issues/176" target="_blank">Github</a> 及 <a href="https://greasyfork.org/scripts/419215" target="_blank">Greasyfork</a></strong> 里面了。</li>
@@ -7823,36 +7823,49 @@ function: {
78237823
</ul>
78247824
<p style="color: #ff3535 !important;">注意:不要完全照搬脚本内置规则,因为和标准 JSON 格式等有所差别,具体请参考下面示例。</p>
78257825
<pre>
7826-
"aaa": {
7827-
"host": "aaa",
7828-
"url": "/^\\/s$/",
7829-
"style": ".aaaa {display: none !important;}",
7830-
"pager": {
7831-
"type": 1,
7832-
"nextL": "id('page')//a[contains(text(),'下一页')]",
7833-
"pageE": "css;aaa",
7834-
"insertP": ["css;.bbb", 3],
7835-
"replaceE": "css;.page",
7836-
"scriptT": 2,
7837-
"interval": 500,
7838-
"scrollD": 1500
7826+
// 大多数网站的规则一般都只需要像第一个 "aaa" 这样的(不要连带复制这行注释说明):
7827+
{
7828+
"aaa": {
7829+
"host": "aaa.com",
7830+
"url": "/xxx/",
7831+
"pager": {
7832+
"nextL": "css;xxx",
7833+
"pageE": "css;xxx",
7834+
"replaceE": "css;xxx",
7835+
"scrollD": 1000
7836+
}
78397837
},
7840-
"function": {
7841-
"bF": "src_bF",
7842-
"bFp": [0, "img[data-src]", "data-src"],
7843-
"aF": "document.body.appendChild(document.createElement('script')).textContent = 'xxx'"
7844-
}
7845-
},
7846-
"bbb": {
7847-
"host": "/\.bbb\.com/",
7848-
"url": "if (location.pathname.indexOf('/s') > -1) {return true;}",
7849-
"pager": {
7850-
"type": 2,
7851-
"nextL": "css;#autopbn",
7852-
"nextText": "下一页",
7853-
"nextTextOf": "下一页",
7854-
"interval": 1000,
7855-
"scrollD": 1500
7838+
"bbb": {
7839+
"host": ["bbb1.com", "bbb2.com"],
7840+
"url": "/^\\/s$/",
7841+
"style": ".aaaa {display: none !important;}",
7842+
"pager": {
7843+
"type": 1,
7844+
"nextL": "id('page')//a[contains(text(),'下一页') or text()='下一页']",
7845+
"pageE": "css;aaa",
7846+
"insertP": ["css;.bbb",3],
7847+
"replaceE": "css;.page",
7848+
"scriptT": 1,
7849+
"interval": 500,
7850+
"scrollD": 1500
7851+
},
7852+
"function": {
7853+
"bF": "src_bF",
7854+
"bFp": [0,"img[data-src]","data-src"],
7855+
"aF": "document.body.appendChild(document.createElement('script')).textContent = 'xxx'"
7856+
}
7857+
},
7858+
"ccc": {
7859+
"host": "/\\.ccc\\.com/",
7860+
"url": "if (location.pathname.indexOf('/s') > -1) {return true;}",
7861+
"pager": {
7862+
"type": 2,
7863+
"nextL": "css;#autopbn",
7864+
"nextText": "下一页",
7865+
"nextTextOf": "下一页",
7866+
"interval": 1000,
7867+
"scrollD": 1500
7868+
}
78567869
}
78577870
}
78587871
</pre>

0 commit comments

Comments
 (0)