LibWebView: Add some helpers for "Copy email/telephone" functionality

Other browsers have a nice little feature where right-clicking on a
`mailto` or `tel` link will let you copy the email address or telephone
number, instead of the full URL. So let's do that!
This commit is contained in:
Sam Atkins 2023-12-05 12:53:55 +00:00 committed by Tim Flynn
commit c8247e5737
Notes: sideshowbarker 2024-07-17 03:30:41 +09:00
2 changed files with 31 additions and 0 deletions

View file

@ -28,4 +28,13 @@ struct URLParts {
};
Optional<URLParts> 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 const&);
String url_text_to_copy(URL const&);
}