mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 05:11:51 +00:00
LibWebView: Add do-not-track setting to about:settings
This commit is contained in:
parent
49dae536a7
commit
1be3e7fd8a
Notes:
github-actions[bot]
2025-04-02 18:17:25 +00:00
Author: https://github.com/trflynn89
Commit: 1be3e7fd8a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4194
Reviewed-by: https://github.com/AtkinsSJ
7 changed files with 66 additions and 0 deletions
|
@ -50,6 +50,10 @@ void SettingsUI::register_interfaces()
|
|||
register_interface("removeAllSiteSettingFilters"sv, [this](auto const& data) {
|
||||
remove_all_site_setting_filters(data);
|
||||
});
|
||||
|
||||
register_interface("setDoNotTrack"sv, [this](auto const& data) {
|
||||
set_do_not_track(data);
|
||||
});
|
||||
}
|
||||
|
||||
void SettingsUI::load_current_settings()
|
||||
|
@ -218,4 +222,12 @@ void SettingsUI::remove_all_site_setting_filters(JsonValue const& site_setting)
|
|||
load_current_settings();
|
||||
}
|
||||
|
||||
void SettingsUI::set_do_not_track(JsonValue const& do_not_track)
|
||||
{
|
||||
if (!do_not_track.is_bool())
|
||||
return;
|
||||
|
||||
WebView::Application::settings().set_do_not_track(do_not_track.as_bool() ? DoNotTrack::Yes : DoNotTrack::No);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue