Issue #2652 - Part2: Add "Clear DNS cache" button to about:networking

Resolves #2652
This commit is contained in:
Moonchild 2024-11-15 12:47:24 +01:00 committed by roytam1
commit 60e671e956
3 changed files with 11 additions and 0 deletions

View file

@ -176,6 +176,14 @@ function init() {
doLookup();
});
let clearDNSCache = document.getElementById("clearDNSCache");
clearDNSCache.addEventListener("click", function() {
Cc["@mozilla.org/network/dns-service;1"]
.getService(Ci.nsIDNSService)
.clearCache();
requestAllNetworkingData();
});
let setLogButton = document.getElementById("set-log-file-button");
setLogButton.addEventListener("click", setLogFile);

View file

@ -96,6 +96,8 @@
</div>
<div id="dns" class="tab" hidden="true">
<button id="clearDNSCache">&aboutNetworking.clearDNSCache;</button>
<br/><br/>
<table>
<thead>
<tr>

View file

@ -41,3 +41,4 @@
<!ENTITY aboutNetworking.dnsLookupButton "Resolve">
<!ENTITY aboutNetworking.dnsDomain "Domain">
<!ENTITY aboutNetworking.dnsLookupTableColumn "IPs">
<!ENTITY aboutNetworking.clearDNSCache "Clear DNS cache">