summaryrefslogtreecommitdiff
path: root/misc/userscripts/qute-keepass
diff options
context:
space:
mode:
authorJay Kamat <jaygkamat@gmail.com>2018-03-22 03:01:50 -0400
committerJay Kamat <jaygkamat@gmail.com>2018-03-22 03:01:50 -0400
commita9a7f5da45a1f731f651e2948c4852e0dc27b6f1 (patch)
tree2bbfe065ca8de153fd353c05662b488b33d7e5e5 /misc/userscripts/qute-keepass
parentb169a1c802e2c90182df76820c00190e4669271e (diff)
downloadqutebrowser-a9a7f5da45a1f731f651e2948c4852e0dc27b6f1.tar.gz
qutebrowser-a9a7f5da45a1f731f651e2948c4852e0dc27b6f1.zip
Fix choking on passwords with <x> syntax in them
Diffstat (limited to 'misc/userscripts/qute-keepass')
-rwxr-xr-xmisc/userscripts/qute-keepass12
1 files changed, 8 insertions, 4 deletions
diff --git a/misc/userscripts/qute-keepass b/misc/userscripts/qute-keepass
index 4d25e7037..70b9a53d7 100755
--- a/misc/userscripts/qute-keepass
+++ b/misc/userscripts/qute-keepass
@@ -80,6 +80,7 @@ group.add_argument('--username-only', '-e',
group.add_argument('--password-only', '-w',
action='store_true', help='Only insert password')
+CMD_DELAY = 50
class ExitCodes(enum.IntEnum):
"""Stores various exit codes groups to use."""
@@ -191,15 +192,18 @@ def run(args):
insert_mode = ';; enter-mode insert' if args.insert_mode else ''
if args.username_only:
- qute_command('fake-key {}{}'.format(username, insert_mode))
+ qute_command('insert-text {}{}'.format(username, insert_mode))
elif args.password_only:
- qute_command('fake-key {}{}'.format(password, insert_mode))
+ qute_command('insert-text {}{}'.format(password, insert_mode))
else:
# Enter username and password using fake-key and <Tab> (which seems to
# work almost universally), then switch back into insert-mode, so the
# form can be directly submitted by hitting enter afterwards
- qute_command('fake-key {} ;; fake-key <Tab> ;; fake-key {}{}'
- .format(username, password, insert_mode))
+ qute_command('insert-text {} ;;'
+ 'later {} fake-key <Tab> ;;'
+ 'later {} insert-text {}{}'
+ .format(username, CMD_DELAY,
+ CMD_DELAY * 2, password, insert_mode))
return ExitCodes.SUCCESS