Skip to content

Commit ab28293

Browse files
committed
新增 [百度贴吧] 搜索结果的支持
1 parent 818098a commit ab28293

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

Autopage.user.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 1.5.5
3+
// @version 1.5.6
44
// @author X.I.U
55
// @description 自动无缝翻页,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、贴吧、豆瓣、微博、千图网、3DM、游侠网、游民星空、Steam 创意工坊、423Down、不死鸟、小众软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、Crackhub213、FitGirl Repacks...
66
// @match *://*/*
@@ -202,6 +202,17 @@
202202
before: baidu_tieba_beforeFunction
203203
}
204204
},
205+
baidu_tieba_search: {
206+
SiteTypeID: 0,
207+
pager: {
208+
type: 1,
209+
nextLink: '//a[@class="next"][@href]',
210+
pageElement: 'css;.s_post_list > .s_post',
211+
HT_insert: ['css;.s_post_list', 3],
212+
replaceE: 'css;.pager.pager-search',
213+
scrollDelta: 1000
214+
}
215+
},
205216
douban_subject_comments: {
206217
SiteTypeID: 0,
207218
pager: {
@@ -618,11 +629,13 @@
618629
if (location.pathname === '/search') curSite = DBSite.google;
619630
break;
620631
case 'tieba.baidu.com': // < 百度贴吧 >
621-
if (location.pathname === '/f') {
632+
if (location.pathname === '/f') { // 帖子列表
622633
// 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
623634
document.lastElementChild.appendChild(document.createElement('style')).textContent = 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}';
624635
baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
625636
curSite = DBSite.baidu_tieba;
637+
} else if (location.pathname === '/f/search/res') { // 吧内搜索/全吧搜索
638+
curSite = DBSite.baidu_tieba_search
626639
}
627640
break;
628641
case 'movie.douban.com': // < 豆瓣评论 >
@@ -832,6 +845,8 @@
832845
let button2 = document.querySelector('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
833846
if (button2) {
834847
button2.click();
848+
} else {
849+
alert('提示:登录后才能发帖!');
835850
}
836851
return false;
837852
}

0 commit comments

Comments
 (0)