From a31b6542529f5042b947b45fdeb8cd51595784fc Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Tue, 30 May 2023 19:13:59 -0300 Subject: Use url netloc as a candidate key for qute-pass --- misc/userscripts/qute-pass | 7 +++++-- 1 file 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: -- cgit v1.2.3-54-g00ecf