(e, l = 'p', low = true)
| 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; |
no outgoing calls
no test coverage detected