Brave DNS Auto Clear

Очищает DNS Brave при обновлении страницы или закрытии вкладки

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Brave DNS Auto Clear
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Очищает DNS Brave при обновлении страницы или закрытии вкладки
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Очистка DNS при обновлении страницы
    window.addEventListener('beforeunload', () => {
        fetch('brave://net-internals/#dns').catch(() => {});
    });

    // При нажатии F5 — тоже сбрасываем DNS (для гарантии)
    window.addEventListener('keydown', e => {
        if (e.key === 'F5') {
            fetch('brave://net-internals/#dns').catch(() => {});
        }
    });
})();