Skip to content

Commit

Permalink
feat: ✨ 新增功能
Browse files Browse the repository at this point in the history
百度搜索
    视频页新增功能 【屏蔽】底部推荐视频
    视频页新增功能 自动跳转至原网页
好看视频
    修复功能覆盖播放按钮的点击事件不能正确阻止调用App唤醒问题
  • Loading branch information
WhiteSevs committed Jul 15, 2024
1 parent 37a55cb commit 2bca303
Show file tree
Hide file tree
Showing 28 changed files with 889 additions and 542 deletions.
4 changes: 2 additions & 2 deletions packages/【移动端】百度系优化/SCRIPT_VERSION.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"time": 1720969840880,
"version": "2024.7.14"
"time": 1721017756004,
"version": "2024.7.15"
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/【移动端】百度系优化/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@element-plus/icons-vue": "^2.3.1",
"@whitesev/domutils": "^1.1.2",
"@whitesev/pops": "^1.2.4",
"@whitesev/utils": "^1.6.0",
"@whitesev/utils": "^1.6.1",
"pinia": "^2.1.7",
"qmsg": "^1.2.1",
"viewerjs": "^1.11.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const BaiduAiQiCha = {
addStyle(AiQiChaShieldCSS);
log.info("插入CSS规则");
this.camouflageBottomPopup();
PopsPanel.execMenu("baidu_aiqicha_shield_carousel", () => {
this.shieldCarousel();
PopsPanel.execMenuOnce("baidu_aiqicha_shield_carousel", () => {
return this.shieldCarousel();
});
PopsPanel.execMenu("baidu_aiqicha_shield_industry_host_news", () => {
this.shieldIndustryHostNews();
PopsPanel.execMenuOnce("baidu_aiqicha_shield_industry_host_news", () => {
return this.shieldIndustryHostNews();
});
},
/**
Expand All @@ -31,14 +31,14 @@ const BaiduAiQiCha = {
*/
shieldCarousel() {
log.info("屏蔽轮播图");
CommonUtils.addBlockCSS("div.index-banner-container.van-swipe");
return CommonUtils.addBlockCSS("div.index-banner-container.van-swipe");
},
/**
* 屏蔽行业热点新闻
*/
shieldIndustryHostNews() {
log.info("屏蔽行业热点新闻");
CommonUtils.addBlockCSS(" div.hot-news");
return CommonUtils.addBlockCSS(" div.hot-news");
},
};
export { BaiduAiQiCha };
28 changes: 15 additions & 13 deletions packages/【移动端】百度系优化/src/main/aistudy/AiStudy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,36 @@ const BaiduAiStudy = {
init() {
addStyle(AiStudyShieldCSS);
log.info("插入CSS规则");
PopsPanel.execMenu("baidu_ai_study_shieldBottomToolBar", () => {
this.shieldBottomToolBar();
PopsPanel.execMenuOnce("baidu_ai_study_shieldBottomToolBar", () => {
return this.shieldBottomToolBar();
});
PopsPanel.execMenu("baidu_ai_study_autoExpandFullText", () => {
this.autoExpandFullText();
PopsPanel.execMenuOnce("baidu_ai_study_autoExpandFullText", () => {
return this.autoExpandFullText();
});
},
/**
* 屏蔽底部工具栏
*/
shieldBottomToolBar() {
log.info("屏蔽底部工具栏");
CommonUtils.addBlockCSS(".gt-edu-h5-c-article-bottom");
return CommonUtils.addBlockCSS(".gt-edu-h5-c-article-bottom");
},
/**
* 自动展开全文
*/
autoExpandFullText() {
log.info("自动展开全文");
/* 点击查看全文 */
CommonUtils.addBlockCSS(
".gt-edu-h5-c-article-content .content-wrapper .detail-wrapper .unfold-wrapper"
);
addStyle(`
.gt-edu-h5-c-article-content .content-wrapper .detail-wrapper{
max-height: unset !important;
}
`);
return [
CommonUtils.addBlockCSS(
".gt-edu-h5-c-article-content .content-wrapper .detail-wrapper .unfold-wrapper"
),
addStyle(`
.gt-edu-h5-c-article-content .content-wrapper .detail-wrapper{
max-height: unset !important;
}
`),
];
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,62 @@ const BaiduBaiJiaHao = {
addStyle(BaiJiaHaoShieldCSS);
log.info("插入CSS规则");
BaiJiaHaoHook.init();
PopsPanel.execMenu("baijiahao_shield_recommended_article", () => {
this.shieldRecommendArticle();
PopsPanel.execMenuOnce("baijiahao_shield_recommended_article", () => {
return this.shieldRecommendArticle();
});
PopsPanel.execMenu("baijiahao_shield_user_comment", () => {
this.shieldUserComment();
PopsPanel.execMenuOnce("baijiahao_shield_user_comment", () => {
return this.shieldUserComment();
});
PopsPanel.execMenu("baijiahao_shield_user_comment_input_box", () => {
this.shieldBottomToolBar();
PopsPanel.execMenuOnce("baijiahao_shield_user_comment_input_box", () => {
return this.shieldBottomToolBar();
});
},
/**
* 【屏蔽】推荐文章
*/
shieldRecommendArticle() {
log.info("【屏蔽】推荐文章");
CommonUtils.addBlockCSS(
".infinite-scroll-component__outerdiv",
"div#page_wrapper > div > div:nth-child(5)",
"div:has(+ .infinite-scroll-component__outerdiv)",
/* 电脑端的左边的按钮-屏蔽 */
"#ssr-content > :last-child",
/* 电脑端的右边的推荐-屏蔽 */
"#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(2)"
);
addStyle(`
/* 电脑端的文章居中 */
#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) {
width: 55% !important;
}`);
/* 某些情况下的CSS */
CommonUtils.addBlockCSS(
'#page_wrapper > div.other > div[class=""]:nth-child(4)'
);
/* 简单UA&链接参数wfr=spide下的精彩推荐 */
CommonUtils.addBlockCSS(
'#page_wrapper div.spider > div[class=""]:nth-child(4)',
'page_wrapper div.spider > div[class=""]:nth-child(5)'
);
/* Gecko的简单UA下的精彩推荐 */
CommonUtils.addBlockCSS('#page_wrapper .searchCraft > div[class=""]');
return [
CommonUtils.addBlockCSS(
".infinite-scroll-component__outerdiv",
"div#page_wrapper > div > div:nth-child(5)",
"div:has(+ .infinite-scroll-component__outerdiv)",
/* 电脑端的左边的按钮-屏蔽 */
"#ssr-content > :last-child",
/* 电脑端的右边的推荐-屏蔽 */
"#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(2)"
),
addStyle(`
/* 电脑端的文章居中 */
#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) {
width: 55% !important;
}`),
/* 某些情况下的CSS */
CommonUtils.addBlockCSS(
'#page_wrapper > div.other > div[class=""]:nth-child(4)'
),
/* 简单UA&链接参数wfr=spide下的精彩推荐 */
CommonUtils.addBlockCSS(
'#page_wrapper div.spider > div[class=""]:nth-child(4)',
'page_wrapper div.spider > div[class=""]:nth-child(5)'
),
/* Gecko的简单UA下的精彩推荐 */
CommonUtils.addBlockCSS('#page_wrapper .searchCraft > div[class=""]'),
];
},
/**
* 【屏蔽】用户评论
*/
shieldUserComment() {
log.info("【屏蔽】用户评论");
CommonUtils.addBlockCSS("#commentModule");
return CommonUtils.addBlockCSS("#commentModule");
},
/**
* 【屏蔽】底部悬浮工具栏
*/
shieldBottomToolBar() {
log.info("【屏蔽】底部悬浮工具栏");
CommonUtils.addBlockCSS("div#wise-invoke-interact-bar");
return CommonUtils.addBlockCSS("div#wise-invoke-interact-bar");
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const BaiduBaiKeTaShuo = {
init() {
addStyle(BaiKeTaShuoShieldCSS);
log.info("插入CSS规则");
PopsPanel.execMenu("baidu_baike_tashuo_remove_bottom_ad", () => {
PopsPanel.execMenuOnce("baidu_baike_tashuo_remove_bottom_ad", () => {
this.removeBottomAd();
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const BaiduChat = {
addStyle(ChatShieldCSS);
log.info("插入CSS规则");
DOMUtils.ready(() => {
PopsPanel.execMenu("baidu_chat_remove_ai_mask", () => {
PopsPanel.execMenuOnce("baidu_chat_remove_ai_mask", () => {
this.removeAiMask();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,51 @@ const BaiduEasyLearn = {
init() {
addStyle(EasyLearnShieldCSS);
log.info("插入CSS规则");
PopsPanel.execMenu("baidu_easylearn_shield_this_question_paper", () => {
this.shieldQuestionPaper();
PopsPanel.execMenuOnce("baidu_easylearn_shield_this_question_paper", () => {
return this.shieldQuestionPaper();
});
PopsPanel.execMenu(
PopsPanel.execMenuOnce(
"baidu_easylearn_shield_good_questions_in_this_volume",
() => {
this.shieldGoodQuestionsInThisVolume();
return this.shieldGoodQuestionsInThisVolume();
}
);
PopsPanel.execMenu("baidu_easylearn_shield_related_test_papers", () => {
this.shieldRelatedTestPapers();
PopsPanel.execMenuOnce("baidu_easylearn_shield_related_test_papers", () => {
return this.shieldRelatedTestPapers();
});
PopsPanel.execMenu("baidu_easylearn_shield_video_explanation", () => {
this.shieldVideoExplanation();
PopsPanel.execMenuOnce("baidu_easylearn_shield_video_explanation", () => {
return this.shieldVideoExplanation();
});
PopsPanel.execMenu("baidu_easylearn_shield_xueba_notes", () => {
this.shieldXuebaNotes();
PopsPanel.execMenuOnce("baidu_easylearn_shield_xueba_notes", () => {
return this.shieldXuebaNotes();
});
PopsPanel.execMenu("baidu_easylearn_shield_bottom_toolbar", () => {
this.shieldBottomToolbar();
PopsPanel.execMenuOnce("baidu_easylearn_shield_bottom_toolbar", () => {
return this.shieldBottomToolbar();
});
PopsPanel.execMenu(
PopsPanel.execMenuOnce(
"baidu_easylearn_unlocking_the_upper_limit_of_search_questions",
() => {
this.hijackUserSearchQuestCount();
}
);
PopsPanel.execMenu("baidu_easylearn_auto_show_answer", () => {
PopsPanel.execMenuOnce("baidu_easylearn_auto_show_answer", () => {
this.showAnswerContent();
});
DOMUtils.ready(() => {
PopsPanel.execMenu("baidu_easylearn_unlocking_top_search_input", () => {
this.allowUserSearchInput();
});
PopsPanel.execMenuOnce(
"baidu_easylearn_unlocking_top_search_input",
() => {
this.allowUserSearchInput();
}
);
});
},
/**
* 屏蔽题卷
*/
shieldQuestionPaper() {
log.info("屏蔽题卷");
CommonUtils.addBlockCSS(
return CommonUtils.addBlockCSS(
".question-shijuan-wrap",
/* PC端 */
".question-cont .timu-wrap .doc-cont-v2 .left"
Expand All @@ -62,14 +65,14 @@ const BaiduEasyLearn = {
*/
shieldGoodQuestionsInThisVolume() {
log.info("屏蔽本卷好题");
CommonUtils.addBlockCSS(".exercise-questions-wrap");
return CommonUtils.addBlockCSS(".exercise-questions-wrap");
},
/**
* 屏蔽本卷相关试卷
*/
shieldRelatedTestPapers() {
log.info("屏蔽本卷相关试卷");
CommonUtils.addBlockCSS(
return CommonUtils.addBlockCSS(
".related-papers-wrap",
/* PC端 */
".question-cont .timu-wrap .doc-cont-v2 .right"
Expand All @@ -80,7 +83,7 @@ const BaiduEasyLearn = {
*/
shieldVideoExplanation() {
log.info("屏蔽视频解析");
CommonUtils.addBlockCSS(
return CommonUtils.addBlockCSS(
".video-doc-compo",
/* PC端 */
".container #questionVideo"
Expand All @@ -91,14 +94,14 @@ const BaiduEasyLearn = {
*/
shieldXuebaNotes() {
log.info("屏蔽学霸");
CommonUtils.addBlockCSS(".note-list");
return CommonUtils.addBlockCSS(".note-list");
},
/**
* 屏蔽底部工具栏
*/
shieldBottomToolbar() {
log.info("屏蔽底部工具栏");
CommonUtils.addBlockCSS(
return CommonUtils.addBlockCSS(
".question-bottom-bar",
"#app .bgk-question-detail .float-btm"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ const BaiduFanYiApp = {
addStyle(FanYiAppShieldCSS);
log.info("插入CSS规则");
this.repairContentHeight();
PopsPanel.execMenu("baidu_fanyi_app_shield_column_information", () => {
this.shieldColumnInformation();
PopsPanel.execMenuOnce("baidu_fanyi_app_shield_column_information", () => {
return this.shieldColumnInformation();
});
PopsPanel.execMenu("baidu_fanyi_app_shield_recommended_for_you", () => {
this.shieldRecommendedForYou();
});
PopsPanel.execMenu("baidu_fanyi_app_shield_i_need_to_follow_along", () => {
this.shieldINeedToFollowAlong();
PopsPanel.execMenuOnce("baidu_fanyi_app_shield_recommended_for_you", () => {
return this.shieldRecommendedForYou();
});
PopsPanel.execMenuOnce(
"baidu_fanyi_app_shield_i_need_to_follow_along",
() => {
return this.shieldINeedToFollowAlong();
}
);
},
/**
* 修复内容高度
Expand All @@ -32,21 +35,21 @@ const BaiduFanYiApp = {
*/
shieldColumnInformation() {
log.info("隐藏专栏信息");
CommonUtils.addBlockCSS("div.fanyi-zhuan-lan-wrapper");
return CommonUtils.addBlockCSS("div.fanyi-zhuan-lan-wrapper");
},
/**
* 隐藏推荐
*/
shieldRecommendedForYou() {
log.info("隐藏推荐");
CommonUtils.addBlockCSS("#fr-section");
return CommonUtils.addBlockCSS("#fr-section");
},
/**
* 隐藏需要跟随
*/
shieldINeedToFollowAlong() {
log.info("隐藏需要跟随");
CommonUtils.addBlockCSS(".cover-all .daily-bottom");
return CommonUtils.addBlockCSS(".cover-all .daily-bottom");
},
};

Expand Down
Loading

0 comments on commit 2bca303

Please sign in to comment.