Просмотр исходного кода

Merge pull request #1386 from Siykt/fix/func-params-regexp

fix: #1372
Ahmad Kholid 1 год назад
Родитель
Сommit
e10721a6e3

+ 5 - 0
src/content/blocksHandler/handlerEventClick.js

@@ -1,4 +1,5 @@
 import { sendMessage } from '@/utils/message';
+import { sleep } from '@/utils/helper';
 import { getElementPosition, simulateClickElement } from '../utils';
 import handleSelector from '../handleSelector';
 
@@ -27,7 +28,11 @@ function eventClick(block) {
             return sendMessage('debugger:send-command', payload, 'background');
           };
 
+          // bypass the bot detection.
+          await executeCommand('mouseMoved');
+          await sleep(100);
           await executeCommand('mousePressed');
+          await sleep(100);
           await executeCommand('mouseReleased');
 
           return;

+ 1 - 1
src/workflowEngine/templating/mustacheReplacer.js

@@ -17,7 +17,7 @@ export function extractStrFunction(str) {
   if (!extractedStr) return null;
   const { 1: name, 2: funcParams } = extractedStr;
   const params = funcParams
-    .split(/,(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/)
+    .split(/,(?=(?:[^'"\\"\\']*['"][^'"]*['"\\"\\'])*[^'"]*$)/)
     .map((param) => param.trim().replace(/^['"]|['"]$/g, '') || '');
 
   return {