JBrowser Source Docs
You are reading the documentation for JBrowser 2.0.1. The newest release is 2.0.3. Go to the latest documentation

jbrowser.core.urls

Generated from the source code of JBrowser 2.0.1.

jbrowser/core/urls.py · 191 lines

URL heuristics: omnibox input classification, host/domain helpers.

Constants#

Name Value
INTERNAL_SCHEMES {'http', 'https', 'file', 'about', 'data', 'view-source', 'chrome', 'qrc', 'ftp', 'blob…
EXTERNAL_SCHEMES {'mailto', 'tel', 'sms', 'callto', 'magnet', 'steam', 'spotify', 'zoommtg', 'msteams', …

Functions#

is_ip#

is_ip(host: str) -> boolsource

is_local_host#

is_local_host(host: str) -> boolsource

registrable_domain#

registrable_domain(host: str) -> strsource

Approximate eTLD+1 (e.g. a.b.example.co.uk -> example.co.uk).

same_site#

same_site(host_a: str, host_b: str) -> boolsource

strip_www#

strip_www(host: str) -> strsource

origin_of#

origin_of(url: QUrl) -> strsource

pretty_url#

pretty_url(url: str | QUrl, keep_path: bool=True) -> strsource

local_path#

local_path(text: str) -> str | Nonesource

The file or folder path typed or pasted in text (C:\Users\..., D:/..., \\server\share, %USERPROFILE%\...; quotes from "Copy as path" are fine), or None when it isn't one.

looks_like_url#

looks_like_url(text: str, dev_hosts: set[str] | None=None) -> boolsource

to_url#

to_url(text: str) -> QUrlsource

Turn user input that looks_like_url into a navigable QUrl.

display_title#

display_title(title: str, url: str) -> strsource