summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmisc/userscripts/qute-lastpass9
-rw-r--r--tests/unit/misc/userscripts/test_qute_lastpass.py1
2 files changed, 9 insertions, 1 deletions
diff --git a/misc/userscripts/qute-lastpass b/misc/userscripts/qute-lastpass
index ac9783641..d2a72f077 100755
--- a/misc/userscripts/qute-lastpass
+++ b/misc/userscripts/qute-lastpass
@@ -60,6 +60,8 @@ argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
help='Encoding used to communicate with subprocesses')
argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
help='Merge pass candidates for fully-qualified and registered domain name')
+argument_parser.add_argument('--no-tld-download', action='store_true',
+ help="Don't download TLD list")
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e',
action='store_true', help='Only insert username')
@@ -117,7 +119,12 @@ def main(arguments):
argument_parser.print_help()
return ExitCodes.FAILURE
- extract_result = tldextract.extract(arguments.url)
+ if arguments.no_tld_download:
+ extract = tldextract.TLDExtract(suffix_list_urls=None)
+ else:
+ extract = tldextract.extract
+
+ extract_result = extract(arguments.url)
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name and finally: the IPv4 address if that's what
diff --git a/tests/unit/misc/userscripts/test_qute_lastpass.py b/tests/unit/misc/userscripts/test_qute_lastpass.py
index 3846028ee..24272a048 100644
--- a/tests/unit/misc/userscripts/test_qute_lastpass.py
+++ b/tests/unit/misc/userscripts/test_qute_lastpass.py
@@ -79,6 +79,7 @@ def arguments_mock():
arguments.merge_candidates = False
arguments.password_only = False
arguments.username_only = False
+ arguments.no_tld_download = True
return arguments