mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWebView: Let Settings clear browsing history
Route the existing Clear Browsing Data dialog through HistoryStore's time-range deletion path as well. That makes the Settings action remove visited pages from persisted history and from history-backed address bar suggestions instead of only touching cache and site data. Add a history checkbox to the dialog, thread its state through the Settings WebUI message, and cover remove_entries_accessed_since() for both transient and persisted stores in TestHistoryStore.
This commit is contained in:
committed by
Andreas Kling
parent
1802a05bc2
commit
c249f0324b
Notes:
github-actions[bot]
2026-04-16 19:02:54 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/c249f0324b2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8933 Reviewed-by: https://github.com/trflynn89
@@ -609,6 +609,13 @@
|
||||
<p class="description">Remove items that help pages load faster</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field-container">
|
||||
<input id="clear-browsing-data-history" type="checkbox" value="" checked />
|
||||
<label for="clear-browsing-data-history">
|
||||
Browsing history
|
||||
<p class="description">Remove visited pages from history and address bar suggestions</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field-container">
|
||||
<input id="clear-browsing-data-site-data" type="checkbox" value="" checked />
|
||||
<label for="clear-browsing-data-site-data">
|
||||
|
||||
@@ -16,6 +16,7 @@ const browsingDataTotalSize = document.querySelector("#browsing-data-total-size"
|
||||
|
||||
const clearBrowsingDataCachedFiles = document.querySelector("#clear-browsing-data-cached-files");
|
||||
const clearBrowsingDataCachedFilesSize = document.querySelector("#clear-browsing-data-cached-files-size");
|
||||
const clearBrowsingDataHistory = document.querySelector("#clear-browsing-data-history");
|
||||
const clearBrowsingDataRemoveData = document.querySelector("#clear-browsing-data-remove-data");
|
||||
const clearBrowsingDataSiteData = document.querySelector("#clear-browsing-data-site-data");
|
||||
const clearBrowsingDataSiteDataSize = document.querySelector("#clear-browsing-data-site-data-size");
|
||||
@@ -135,10 +136,14 @@ clearBrowsingDataTimeRange.addEventListener("change", () => {
|
||||
});
|
||||
|
||||
function setRemoveDataEnabledState() {
|
||||
clearBrowsingDataRemoveData.disabled = !clearBrowsingDataCachedFiles.checked && !clearBrowsingDataSiteData.checked;
|
||||
clearBrowsingDataRemoveData.disabled =
|
||||
!clearBrowsingDataCachedFiles.checked &&
|
||||
!clearBrowsingDataHistory.checked &&
|
||||
!clearBrowsingDataSiteData.checked;
|
||||
}
|
||||
|
||||
clearBrowsingDataCachedFiles.addEventListener("change", setRemoveDataEnabledState);
|
||||
clearBrowsingDataHistory.addEventListener("change", setRemoveDataEnabledState);
|
||||
clearBrowsingDataSiteData.addEventListener("change", setRemoveDataEnabledState);
|
||||
|
||||
clearBrowsingDataRemoveData.addEventListener("click", () => {
|
||||
@@ -147,6 +152,7 @@ clearBrowsingDataRemoveData.addEventListener("click", () => {
|
||||
ladybird.sendMessage("clearBrowsingData", {
|
||||
since: since?.epochMilliseconds,
|
||||
cachedFiles: clearBrowsingDataCachedFiles.checked,
|
||||
history: clearBrowsingDataHistory.checked,
|
||||
siteData: clearBrowsingDataSiteData.checked,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user