diff --git a/src/social-network-provider/twitter.com/ui/tasks.ts b/src/social-network-provider/twitter.com/ui/tasks.ts index ee0af486e6dc..715f414cc9d9 100644 --- a/src/social-network-provider/twitter.com/ui/tasks.ts +++ b/src/social-network-provider/twitter.com/ui/tasks.ts @@ -25,7 +25,7 @@ const taskPasteIntoBio = async (text: string) => { .evaluate()! .click() } catch { - prompt(geti18nString('automation_request_click_edit_bio_button')) + alert(geti18nString('automation_request_click_edit_bio_button')) } await sleep(800) try { diff --git a/src/social-network-provider/twitter.com/utils/selector.ts b/src/social-network-provider/twitter.com/utils/selector.ts index 35bd5201873d..6433c35a7638 100644 --- a/src/social-network-provider/twitter.com/utils/selector.ts +++ b/src/social-network-provider/twitter.com/utils/selector.ts @@ -18,9 +18,14 @@ const querySelectorAll = (selector: string) => { export const rootSelector = () => querySelector('body') -export const bioQueryString = '[href*="header_photo"] + div [data-testid="UserDescription"]' +export const bioQueryString = '[href*="header_photo"] + div [data-testid="UserDescription"]' // TODO: this is invalid + +export const bioCard = () => + querySelector('[href*="photo"]') + .map(x => x.parentElement!.parentElement) + .querySelector('[data-testid="UserDescription"]') + .map(x => x.parentElement!.parentElement) -export const bioCard = () => querySelector('[href*="header_photo"] + div') export const postViewMain = () => querySelector('[role="progressbar"] + div + div > div > div > div:first-of-type') diff --git a/src/social-network-provider/twitter.com/utils/user.ts b/src/social-network-provider/twitter.com/utils/user.ts index 7f71ef1b8a40..0be732739d69 100644 --- a/src/social-network-provider/twitter.com/utils/user.ts +++ b/src/social-network-provider/twitter.com/utils/user.ts @@ -8,7 +8,6 @@ import Services from '../../../extension/service' * @link https://help.twitter.com/en/managing-your-account/twitter-username-rules */ export const usernameValidator: SocialNetworkWorkerAndUI['isValidUsername'] = (name: string) => { - console.log(name) for (const v of [/(twitter|admin)/i, /.{16,}/, /[^A-Za-z0-9_]/]) { if (!isNull(v.exec(name))) { return false