mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWebView+UI: Migrate Ladybird's command line flags to LibWebView
Currently, if we want to add a new e.g. WebContent command line option, we have to add it to all of Qt, AppKit, and headless-browser. (Or worse, we only add it to one of these, and we have feature disparity). To prevent this, this moves command line flags to WebView::Application. The flags are assigned to ChromeOptions and WebContentOptions structs. Each chrome can still add its platform-specific options; for example, the Qt chrome has a flag to enable Qt networking. There should be no behavior change here, other than that AppKit will now support command line flags that were previously only supported by Qt.
This commit is contained in:
parent
0e640f6f70
commit
5f8d852dae
Notes:
github-actions[bot]
2024-08-01 09:39:41 +00:00
Author: https://github.com/trflynn89
Commit: 5f8d852dae
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/910
Reviewed-by: https://github.com/ADKaster
35 changed files with 427 additions and 440 deletions
|
@ -72,6 +72,22 @@ Optional<URL::URL> sanitize_url(StringView url, Optional<StringView> search_engi
|
|||
return result;
|
||||
}
|
||||
|
||||
Vector<URL::URL> sanitize_urls(ReadonlySpan<ByteString> raw_urls, URL::URL const& new_tab_page_url)
|
||||
{
|
||||
Vector<URL::URL> sanitized_urls;
|
||||
sanitized_urls.ensure_capacity(raw_urls.size());
|
||||
|
||||
for (auto const& raw_url : raw_urls) {
|
||||
if (auto url = sanitize_url(raw_url); url.has_value())
|
||||
sanitized_urls.unchecked_append(url.release_value());
|
||||
}
|
||||
|
||||
if (sanitized_urls.is_empty())
|
||||
sanitized_urls.append(new_tab_page_url);
|
||||
|
||||
return sanitized_urls;
|
||||
}
|
||||
|
||||
static URLParts break_file_url_into_parts(URL::URL const& url, StringView url_string)
|
||||
{
|
||||
auto scheme = url_string.substring_view(0, url.scheme().bytes_as_string_view().length() + "://"sv.length());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue