keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.16k stars 1.42k forks source link

Feature: auto-type token to wait for [matched] window title change; e.g. {change_title /my.bank.*verify/} #2060

Closed nmschulte closed 5 years ago

nmschulte commented 6 years ago

Using {delay n} works decently well, but suffers requiring a generous timeout to compensate for different connections and service latencies. It seems detecting a specific window title change or even a change/count at all would be useful to mitigate this. An auto-type instruction of {change_title /regexp/} or similar should work, possibly with a configurable watchdog/timeout and relaxed/no pattern matching if that's too complex.

TheZ3ro commented 6 years ago

I can't understand your request, can you please make an usage example?

grrttedwards commented 6 years ago

I think what they're getting at is something along the lines of the behavior of WinWaitActive from AutoIt/AutoHotkey. i.e.

Pauses execution of the script until the requested window is active.

See AutoHotkey docs or AutoIt docs

nmschulte commented 6 years ago

I can't understand your request, can you please make an usage example?

I use KeePassX to authenticate to web services. Some of these services don't allow inputting all of the credentials in a single step, and sometimes the delay between steps takes a long time. What this leads to is an entry with a custom auto-type sequence with a long delay, like the following:

{USERNAME}{ENTER}{DELAY 10000}{PASSWORD}{ENTER}

The core idea here is to add an auto-type token that instructs KeePassX to wait for a change in window title before proceeding, much like {delay n} delays for n milliseconds before proceeding. This instruction could be as simple as "wait for any change" (which would probably not actually work for my use-case: details here), or my preference: to wait for a change matching a pattern (by regular expression).

This idea can be expanded to make it more useful:


Three step authentication process example.

Service delays between steps depend on multiple factors, including device bandwidth, geolocation, number of tangentially incident gravitational waves, etc.

  1. title is: "Hello! step 1: username/login", page has form for username submission
  2. title is: "Hi nmschulte! step 2: password", page displays username and has form for password submission
  3. title is: "Wait, nmschulte! step 3: verification", page displays username and has form for secret question/verification submission

The auto-type sequence, using the ideas here, might look like this:

{USERNAME}{ENTER}{WAIT_TITLE /step 2.*password/}{PASSWORD}{ENTER}{WAIT_TITLE /step 3.*verification/}I love lamp.{ENTER}
TheZ3ro commented 6 years ago

Like you said, many applications/pages don't change their titles between steps. The solution when the "delay" is too much or it's not usable is to use 2 different autotype sequence and manually trigger the first one and then the second one.

Also the WAIT_TITLE solution you proposed can be dangerous if the user don't set a proper filter and personally I would like to avoid it if possible