import from UXP: Issue #2652 - Part2: Add "Clear DNS cache" button to about:networking (60e671e9)

This commit is contained in:
2024-11-21 21:43:35 +08:00
parent 7ca9f8abdb
commit 64423f976e
3 changed files with 11 additions and 0 deletions
+8
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);
+2
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>
@@ -41,3 +41,4 @@
<!ENTITY aboutNetworking.dnsLookupButton "Resolve">
<!ENTITY aboutNetworking.dnsDomain "Domain">
<!ENTITY aboutNetworking.dnsLookupTableColumn "IPs">
<!ENTITY aboutNetworking.clearDNSCache "Clear DNS cache">