mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 18:46:03 +00:00
Browser+LibWeb+WebContent: Implement per-URL-pattern proxies
...at least for SOCKS5.
This commit is contained in:
parent
f9fc28931f
commit
a42e03b01a
Notes:
sideshowbarker
2024-07-17 14:14:53 +09:00
Author: https://github.com/alimpfard
Commit: a42e03b01a
Pull-request: https://github.com/SerenityOS/serenity/pull/13548
Reviewed-by: https://github.com/AtkinsSJ
15 changed files with 155 additions and 6 deletions
|
@ -575,15 +575,34 @@ void BrowserWindow::content_filters_changed()
|
|||
});
|
||||
}
|
||||
|
||||
void BrowserWindow::proxy_mappings_changed()
|
||||
{
|
||||
tab_widget().for_each_child_of_type<Browser::Tab>([](auto& tab) {
|
||||
tab.proxy_mappings_changed();
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
void BrowserWindow::config_string_did_change(String const& domain, String const& group, String const& key, String const& value)
|
||||
{
|
||||
if (domain != "Browser" || group != "Preferences")
|
||||
if (domain != "Browser")
|
||||
return;
|
||||
|
||||
if (key == "SearchEngine")
|
||||
Browser::g_search_engine = value;
|
||||
else if (key == "Home")
|
||||
Browser::g_home_url = value;
|
||||
if (group == "Preferences") {
|
||||
if (key == "SearchEngine")
|
||||
Browser::g_search_engine = value;
|
||||
else if (key == "Home")
|
||||
Browser::g_home_url = value;
|
||||
} else if (group.starts_with("Proxy:")) {
|
||||
dbgln("Proxy mapping changed: {}/{} = {}", group, key, value);
|
||||
auto proxy_spec = group.substring_view(6);
|
||||
auto existing_proxy = Browser::g_proxies.find(proxy_spec);
|
||||
if (existing_proxy.is_end())
|
||||
Browser::g_proxies.append(proxy_spec);
|
||||
|
||||
Browser::g_proxy_mappings.set(key, existing_proxy.index());
|
||||
proxy_mappings_changed();
|
||||
}
|
||||
|
||||
// TODO: ColorScheme
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue