Check whether a hostname is in a known TLD. Add function to nsIEffectiveTLDService

NEW
Unassigned

Status

()

Core
Networking
P5
enhancement
7 years ago
7 months ago

People

(Reporter: BenB, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-would-take])

(Reporter)

Description

7 years ago
I'd like to check whether a hostname ends in a known TLD. I don't want to do DNS lookups.
Possible usecases for that:
- More extensive checks on hostnames entered by the user, where apppropriate
- Guessing whether a given string is a hostname or freetext URL, e.g.
  - in the awesomebar
  - in the URL recognition in plaintext mails

We have nsIEffectiveTLDService (the origin of <http://www.publicsuffix.org>), but getBaseDomainFromHost("utter.non.sense") returns "non.sense". That makes it useless for my usecase.

I see no other function to check whether the TLD is in the list at all or not. Also, the list is unfortunately directly compiled in, so I can't even load and parse it myself.
<http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/dns/nsIEffectiveTLDService.idl>
Whiteboard: [necko-would-take]

Updated

a year ago
Summary: Check whether a hostname is in a known TLD. Add function to nsIEffectiveTLDService. → Check whether a hostname is in a known TLD. Add function to nsIEffectiveTLDService
You need to log in before you can comment on or make changes to this bug.