(function ($, Drupal, settings) { "use strict"; function is_spider() { if (/HeadlessChrome/.test(navigator.userAgent) || // headless test // languages test !navigator.languages || navigator.languages.length === 0) { return true; } const permissionStatus = (async () => { const permissionStatus = await navigator.permissions.query({ name: 'notifications' }); if (Notification.permission === 'denied' && permissionStatus.state === 'prompt') { // Test Failed... } })(); if (Notification.permission === 'denied' && permissionStatus.state === 'prompt') { return true; } const r = []; const w = ['webdriver', '__driver_evaluate', '__webdriver_evaluate', ' __selenium_evaluate', '__fxdriver_evaluate', '__driver_unwrapped', '__webdriver_unwrapped', '__selenium_unwrapped', '__fxdriver_unwrapped', '_Selenium_IDE_Recorder', '_selenium', 'calledSelenium', '_WEBDRIVER_ELEM_CACHE', 'ChromeDriverw', 'driver-evaluate', 'webdriver-evaluate', 'selenium-evaluate', 'webdriverCommand', 'webdriver-evaluate-response', '__webdriverFunc', '__webdriver_script_fn', '__$webdriverAsyncExecutor', '__lastWatirAlert', '__lastWatirConfirm', '__lastWatirPrompt', '$chrome_asyncScriptInfo', '$cdc_asdjflasutopfhvcZLmcfl_', '_phantom', '_phantomas', ]; w.forEach((t) => { if (!!window[t] || !!window.document.documentElement.getAttribute(t) || !!navigator[t]) { r.push(t); } }); return r.length > 0; } function createUuid() { var e = (new Date).getTime(), t = Math.floor(90 * Math.random()) + 10; return ["site", e, t].join(""); } $(function () { $(".block-navbar14 .search-icon-box .icon-common_icon_search").addClass("active-color") // $(".block-title.block-content-title").addClass("select-color") //棣栭〉鍏充簬鎴戜滑鍒囨崲 $(".front-aboutus.front-aboutus22 .company_advantage .item").hover(function (){ $(this).addClass("active-item").siblings().removeClass("active-item") $(".front-aboutus22 .company_advantage .item .icon-arrowdown").removeClass("active-color") $(this).find(".icon-arrowdown").addClass("active-color") }) }); Drupal.behaviors.spider = { attach: function (context, settings) { if($('input[name="suijizhi"]').length > 0){ $('input[name="suijizhi"]').val(createUuid()); } } } if($('input[name="suijizhi"]').length > 0){ $('input[name="suijizhi"]').val(createUuid()); } var len = 0 $(document).mousemove(function(event) { len++ if($('input[name="shifoupachong"]').length > 0){ $('input[name="shifoupachong"]').val("length:"+len); } }); $(document).on('touchmove', function(event) { len++; if ($('input[name="shifoupachong"]').length > 0) { $('input[name="shifoupachong"]').val("length:" + len); } }); })(jQuery, Drupal, drupalSettings);