|
|
@@ -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(),
|