mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 06:38:22 +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
|
@ -334,6 +334,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Privacy</div>
|
||||
<div class="card-body">
|
||||
<div class="card-group toggle-container">
|
||||
<label for="do-not-track-toggle">Send web sites a "Do Not Track" request</label>
|
||||
<input id="do-not-track-toggle" type="checkbox" switch />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="button-container">
|
||||
<button id="restore-defaults" class="primary-button">Restore Defaults</button>
|
||||
</div>
|
||||
|
@ -378,6 +388,7 @@
|
|||
const siteSettingsInput = document.querySelector("#site-settings-input");
|
||||
const siteSettingsRemoveAll = document.querySelector("#site-settings-remove-all");
|
||||
const siteSettingsTitle = document.querySelector("#site-settings-title");
|
||||
const doNotTrackToggle = document.querySelector("#do-not-track-toggle");
|
||||
const restoreDefaults = document.querySelector("#restore-defaults");
|
||||
|
||||
window.settings = {};
|
||||
|
@ -412,6 +423,8 @@
|
|||
if (siteSetting === "autoplay") {
|
||||
showSiteSettings("Autoplay", window.settings.autoplay);
|
||||
}
|
||||
|
||||
doNotTrackToggle.checked = window.settings.doNotTrack;
|
||||
};
|
||||
|
||||
newTabPageURL.addEventListener("change", () => {
|
||||
|
@ -609,6 +622,10 @@
|
|||
event.stopPropagation();
|
||||
});
|
||||
|
||||
doNotTrackToggle.addEventListener("change", () => {
|
||||
ladybird.sendMessage("setDoNotTrack", doNotTrackToggle.checked);
|
||||
});
|
||||
|
||||
restoreDefaults.addEventListener("click", () => {
|
||||
ladybird.sendMessage("restoreDefaultSettings");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue