PageSourceSearch

https://lingyuzhao.top/js/beforeFun.js

js lingyuzhao.top collected 2026-10-06 13:15:34 UTC 1,173 bytes, 31 lines download raw bytes

1// Ò»ÇвÙ×÷¿ªÊ¼Ö®Ç°µÄº¯Êý
2function isFirstVisit() {
3    // ¼ì²é localStorage ÖÐÊÇ·ñÓÐ 'www.lingyuzhao.top' Õâ¸ö¼ü
4    return !localStorage.getItem('www.lingyuzhao.top');
5}
6
7function setNotFirstVisit() {
8    // ÉèÖà 'www.lingyuzhao.top' ¼ü£¬±íʾÒѾ­·ÃÎʹýÁË
9    localStorage.setItem('www.lingyuzhao.top', 'true');
10}
11
12/**
13 * ¼ì²éµ±Ç°Óû§ÊÇ·ñÕýÔÚʹÓÃÒÆ¶¯É豸½øÐÐä¯ÀÀ
14 * @return {boolean} Èç¹ûÊÇʹÓõÄÒÆ¶¯É豸 ÔÚÕâÀï»á·µ»Ø true
15 */
16function isMobileDeviceTemp() {
17    const userAgent = navigator.userAgent || navigator.vendor || window.opera;
18    // ¶ÔÓÚiPad£¬Õâ¿ÉÄÜ»áÓë×ÀÃæ°æSafariµÄÓû§´úÀí×Ö·û´®»ìÏý£¬ËùÒÔÐèÒªÏȼì²é
19    return /iPad|Macintosh/.test(userAgent) && 'ontouchend' in document || /Mobi|Android/i.test(userAgent);
20}
21
22
23// ¼ì²âÊÇ·ñΪÁ´½Ó·ÃÎÊ Á´½Ó²»ÐèÒªÏÔʾ»¶Ó­Ò³
24function isLink() {
25    // Ê×ÏȲ鿴µ±Ç°ÍøÖ·ÊÇ·ñ°üº¬ link ²ÎÊý
26    return window.location.href.indexOf('link=') !== -1 || window.location.href.indexOf('okPage') !== -1 || window.location.href.indexOf('page') !== -1;
27}
28
29let isHuman = false;
30document.addEventListener('mousemove', () => { isHuman = true; });
31document.addEventListener('touchstart', () => { isHuman = true; });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.