summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-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: