mirror of
https://github.com/XIU2/UserScript.git
synced 2026-09-22 15:06:57 +00:00
优化 代码(区分大小写相关)
This commit is contained in:
+6
-6
@@ -3,7 +3,7 @@
|
||||
// @name:zh-CN 自动无缝翻页
|
||||
// @name:zh-TW 自動無縫翻頁
|
||||
// @name:en AutoPager
|
||||
// @version 5.5.0
|
||||
// @version 5.5.1
|
||||
// @author X.I.U
|
||||
// @description ⭐无缝衔接下一页内容到网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、微博、NGA、V2EX、煎蛋网、龙的天空、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
|
||||
// @description:zh-TW ⭐無縫銜接下一頁內容到網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
for (let i of DBSite[now].host) { // 遍历 数组
|
||||
// 针对自定义翻页规则中的正则
|
||||
if (typeof i === 'string' && i.slice(0,1) === '/') i = new RegExp(i.slice(1,i.length-1), 'i')
|
||||
if (typeof i === 'string' && i.slice(0,1) === '/') i = new RegExp(i.slice(1,i.length-1))
|
||||
if ((i instanceof RegExp && i.test(location.hostname)) || (typeof i === 'string' && i === location.hostname)) {
|
||||
|
||||
if (self != top) {if (!DBSite[now].iframe) break end;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
|
||||
@@ -179,7 +179,7 @@
|
||||
// 如果是 正则/字符串
|
||||
} else {
|
||||
// 针对自定义翻页规则中的正则
|
||||
if (typeof DBSite[now].host === 'string' && DBSite[now].host.slice(0,1) === '/') DBSite[now].host = new RegExp(DBSite[now].host.slice(1,DBSite[now].host.length-1), 'i')
|
||||
if (typeof DBSite[now].host === 'string' && DBSite[now].host.slice(0,1) === '/') DBSite[now].host = new RegExp(DBSite[now].host.slice(1,DBSite[now].host.length-1))
|
||||
if ((DBSite[now].host instanceof RegExp && DBSite[now].host.test(location.hostname)) || (typeof DBSite[now].host === 'string' && DBSite[now].host === location.hostname)) {
|
||||
|
||||
if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
|
||||
@@ -3263,7 +3263,7 @@ function: {
|
||||
urlC = true;
|
||||
}
|
||||
// 判断 URL 是否存在指定文本
|
||||
function indexOF(e, l = 'p', low = false){
|
||||
function indexOF(e, l = 'p', low = true){
|
||||
switch (l) {
|
||||
case 'h':
|
||||
l = location.href; break;
|
||||
@@ -3273,11 +3273,11 @@ function: {
|
||||
l = location.search; break;
|
||||
}
|
||||
//console.log(l,e,l.indexOf(e))
|
||||
if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写
|
||||
if (e instanceof RegExp) {
|
||||
if (e.test(l)) return true
|
||||
} else {
|
||||
if (l.indexOf(e) > -1) return true
|
||||
if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写(即不区分大小写)
|
||||
if (l.indexOf(e) != -1) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user