From f66c6ecbf9234ac3adb59850acd4fa0e115f711c Mon Sep 17 00:00:00 2001 From: Maks Snegov Date: Sat, 27 Apr 2024 22:47:35 -0700 Subject: [PATCH] Close modal warning on signin page --- scripts/content.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/content.js b/scripts/content.js index d2d80c4..010371f 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -197,6 +197,18 @@ async function goToDashboardPage() { } async function enterCredentials(username, password) { + // close warning modal + let modalElement = Array.from(document.querySelectorAll('div')) + .find(d => d.textContent.includes('You need to sign in or sign up before continuing.')); + if (modalElement && window.getComputedStyle(modalElement).display !== 'none') { + let buttons = Array.from(modalElement.querySelectorAll('button')); + let okButton = buttons.find(b => b.textContent === 'OK'); + if (okButton) { + okButton.click(); + await delay(PAGE_WAIT_TIME); + } + } + document.getElementById("user_email").value = username; document.getElementById("user_password").value = password; let policyConfirmed = document.querySelector('[for="policy_confirmed"]');