Free4talk keep chat

Makes the chat in the rooms not delete after refreshing

当前为 2023-12-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Free4talk keep chat
  3. // @version 1.0
  4. // @description Makes the chat in the rooms not delete after refreshing
  5. // @author Azeez
  6. // @match https://www.free4talk.com/room/*
  7. // @grant none
  8. // @license MIT
  9. // @namespace https://greasyfork.org/users/1095860
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. // Check if the keep-chat parameter is already present
  15. if (!window.location.search.includes('keep-chat=true')) {
  16. // Add the keep-chat parameter to the current URL
  17. var separator = window.location.href.includes('?') ? '&' : '?';
  18. var updatedURL = window.location.href + separator + 'keep-chat=true';
  19. // Update the URL
  20. window.history.replaceState({}, document.title, updatedURL);
  21. }
  22. })();