mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 02:56:10 +00:00
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:
parent
db9a507f7f
commit
c8247e5737
Notes:
sideshowbarker
2024-07-17 03:30:41 +09:00
Author: https://github.com/AtkinsSJ
Commit: c8247e5737
Pull-request: https://github.com/SerenityOS/serenity/pull/22173
Reviewed-by: https://github.com/trflynn89
2 changed files with 31 additions and 0 deletions
|
@ -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&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue