From 60e671e956938a46a9da9a11e973eada03ca11d2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 15 Nov 2024 12:47:24 +0100 Subject: [PATCH] Issue #2652 - Part2: Add "Clear DNS cache" button to about:networking Resolves #2652 --- toolkit/content/aboutNetworking.js | 8 ++++++++ toolkit/content/aboutNetworking.xhtml | 2 ++ toolkit/locales/en-US/chrome/global/aboutNetworking.dtd | 1 + 3 files changed, 11 insertions(+) diff --git a/toolkit/content/aboutNetworking.js b/toolkit/content/aboutNetworking.js index 9400ae9d70..633af63c0e 100644 --- a/toolkit/content/aboutNetworking.js +++ b/toolkit/content/aboutNetworking.js @@ -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); diff --git a/toolkit/content/aboutNetworking.xhtml b/toolkit/content/aboutNetworking.xhtml index 440ee78385..17bcc2ac49 100644 --- a/toolkit/content/aboutNetworking.xhtml +++ b/toolkit/content/aboutNetworking.xhtml @@ -96,6 +96,8 @@