summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Alsina <roberto.alsina@gmail.com>2023-05-30 19:13:59 -0300
committerRoberto Alsina <roberto.alsina@gmail.com>2023-05-30 19:13:59 -0300
commita31b6542529f5042b947b45fdeb8cd51595784fc (patch)
tree398ead6525e40b0cd47f9842f3bc8df11170860b
parentf26ea37c4132a90dea4cd9ff321995f65315b351 (diff)
downloadqutebrowser-a31b6542529f5042b947b45fdeb8cd51595784fc.tar.gz
qutebrowser-a31b6542529f5042b947b45fdeb8cd51595784fc.zip
Use url netloc as a candidate key for qute-pass
-rwxr-xr-xmisc/userscripts/qute-pass7
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass
index bdee94bb5..e3215e124 100755
--- a/misc/userscripts/qute-pass
+++ b/misc/userscripts/qute-pass
@@ -58,6 +58,7 @@ import re
import shlex
import subprocess
import sys
+from urllib.parse import urlparse
import tldextract
@@ -221,7 +222,7 @@ def main(arguments):
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name, the IPv4 address if that's what the URL represents and finally the private domain
- # (if a non-public suffix was used).
+ # (if a non-public suffix was used), and the URL netloc.
candidates = set()
attempted_targets = []
@@ -230,7 +231,9 @@ def main(arguments):
private_domain = ('.'.join((extract_result.subdomain, extract_result.domain))
if extract_result.subdomain else extract_result.domain)
- for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4, private_domain]):
+ netloc = urlparse(arguments.url).netloc
+
+ for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4, private_domain, netloc]):
attempted_targets.append(target)
target_candidates = find_pass_candidates(target, unfiltered=arguments.unfiltered)
if not target_candidates: