MCPcopy Index your code
hub / github.com/XIU2/UserScript / indexOF

Function indexOF

Autopage.user.js:2521–2538  ·  view source on GitHub ↗
(e, l = 'p', low = true)

Source from the content-addressed store, hash-verified

2519 }
2520 // 判断 URL 是否存在指定文本
2521 function indexOF(e, l = 'p', low = true){
2522 switch (l) {
2523 case 'h':
2524 l = location.href; break;
2525 case 'p':
2526 l = location.pathname; break;
2527 case 's':
2528 l = location.search; break;
2529 }
2530 //console.log(l,e,l.indexOf(e))
2531 if (e instanceof RegExp) {
2532 if (e.test(l)) return true
2533 } else {
2534 if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写(即不区分大小写)
2535 if (l.indexOf(e) != -1) return true
2536 }
2537 return false
2538 }
2539 // 判断网站标题是否包含指定文字
2540 function isTitle(title) {
2541 return document.title.indexOf(title) > -1;

Callers 8

setDBSiteFunction · 0.85
discuz_Function · 0.85
nexusmods_nextLFunction · 0.85
getNextEPFunction · 0.85
getNextSPFunction · 0.85
getNextEPNFunction · 0.85
getNextUPNFunction · 0.85
getNextUPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected