Browse Source

fix: step 8 use native click + form submit fallback

simulateClick dispatches synthetic MouseEvent which may be rejected
by isTrusted checks. Use native .click() and form.requestSubmit()
as fallback for OAuth consent page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chendeben 4 tháng trước cách đây
mục cha
commit
6b57f7e963
1 tập tin đã thay đổi với 12 bổ sung3 xóa
  1. 12 3
      content/signup-page.js

+ 12 - 3
content/signup-page.js

@@ -384,9 +384,18 @@ async function step8_findAndClick() {
   continueBtn.focus();
   await sleep(250);
 
-  // Click directly from content script — no debugger needed
-  simulateClick(continueBtn);
-  log('Step 8: Clicked "继续" button directly.', 'ok');
+  // Click using native .click() — more reliable than synthetic MouseEvent for trusted forms
+  continueBtn.click();
+  log('Step 8: Clicked "继续" button via .click()', 'ok');
+
+  // Fallback: if the button is inside a form, also try submitting the form directly
+  await sleep(2000);
+  const form = continueBtn.closest('form');
+  if (form && location.href.includes('authorize')) {
+    log('Step 8: Also submitting parent form as fallback...');
+    form.requestSubmit ? form.requestSubmit(continueBtn) : form.submit();
+  }
+
   return {
     clicked: true,
     buttonText: (continueBtn.textContent || '').trim(),