Free4talk keep chat

Makes the chat in the rooms not delete after refreshing

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Free4talk keep chat
// @version      1.0
// @description  Makes the chat in the rooms not delete after refreshing
// @author       Azeez
// @match        https://www.free4talk.com/room/*
// @grant        none
// @license MIT
// @namespace https://greasyfork.org/users/1095860
// ==/UserScript==

(function() {
    'use strict';
    // Check if the keep-chat parameter is already present
    if (!window.location.search.includes('keep-chat=true')) {
        // Add the keep-chat parameter to the current URL
        var separator = window.location.href.includes('?') ? '&' : '?';
        var updatedURL = window.location.href + separator + 'keep-chat=true';
        // Update the URL
        window.history.replaceState({}, document.title, updatedURL);
    }
})();