Update public/assets/js/register.js

This commit is contained in:
sent 2025-06-01 19:49:22 -07:00
parent 4658e475ef
commit f0529b100e

View File

@ -1,39 +1,4 @@
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const originalLog = console.log;
const originalWarn = console.warn;
const originalError = console.error;
const scriptLogs = [];
function isScriptLog(args) {
return args[0] && (args[0].includes('%c[+]%c') || args[0].includes('%c[*]%c') || args[0].includes('%c[#]%c') || args[0].includes('%c[-]%c') || args[0].includes('%c[!]%c'));
}
console.log = function(...args) {
if (isScriptLog(args)) {
scriptLogs.push(args);
}
originalLog.apply(console, args);
};
console.warn = function(...args) {
if (isScriptLog(args)) {
scriptLogs.push(args);
}
originalWarn.apply(console, args);
};
console.error = function(...args) {
if (isScriptLog(args)) {
scriptLogs.push(args);
}
originalError.apply(console, args);
};
setInterval(() => {
const currentLogs = [...scriptLogs];
console.clear();
currentLogs.forEach(log => originalLog.apply(console, log));
}, 400);
const defaultWispUrl = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/w/`; const defaultWispUrl = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/w/`;
let currentWispUrl = localStorage.getItem('customWispUrl') || defaultWispUrl; let currentWispUrl = localStorage.getItem('customWispUrl') || defaultWispUrl;