jcq преди 6 дни
родител
ревизия
5a8f2c626f
променени са 2 файла, в които са добавени 22 реда и са изтрити 2 реда
  1. 1 1
      package.json
  2. 21 1
      src/index.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "utm-params-extractor-test",
-  "version": "1.0.12",
+  "version": "1.0.13",
   "description": "Extract UTM parameters from URL and browser information",
   "main": "dist/main.js",
   "scripts": {

+ 21 - 1
src/index.js

@@ -247,7 +247,27 @@ import FingerprintJS from '@fingerprintjs/fingerprintjs';
                                 countdownModal.appendChild(text);
                                 countdownMask.appendChild(countdownModal);
                                 document.body.appendChild(countdownMask);
-
+                                
+                                if(triggerMode === 2 ||(data.data.url == '' && triggerMode === 3)){
+                                    const close = document.createElement('div');
+                                    close.innerText = '关闭';
+                                    close.style.marginTop = '26px';
+                                    close.style.background = '#007bff';
+                                    close.style.color = '#fff';
+                                    close.style.border = 'none';
+                                    close.style.borderRadius = '10px';
+                                    close.style.padding = '8px 16px';
+                                    close.style.cursor = 'pointer';
+                                    close.style.fontSize='14px'
+                                    
+                                    // 添加关闭事件处理
+                                    close.onclick = function() {
+                                        document.body.removeChild(countdownMask);
+                                    };
+                                    countdownModal.appendChild(close);
+                                    return
+                                }
+                                
                                 const timer = setInterval(() => {
                                     countdown--;
                                     text.innerText = `即将跳转,${countdown}秒...`;