/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace WebView { bool is_public_suffix(StringView host); Optional get_public_suffix(StringView host); enum class AppendTLD { No, Yes, }; Optional sanitize_url(StringView, Optional search_engine = {}, AppendTLD = AppendTLD::No); Vector sanitize_urls(ReadonlySpan raw_urls, URL::URL const& new_tab_page_url); struct URLParts { StringView scheme_and_subdomain; StringView effective_tld_plus_one; StringView remainder; }; Optional break_url_into_parts(StringView url); // These are both used for the "right-click -> copy FOO" interaction for links. enum class URLType { Email, Telephone, Other, }; URLType url_type(URL::URL const&); String url_text_to_copy(URL::URL const&); }