解決
iframe大法
(function(){var iframe = document.createElement('iframe');document.body.appendChild(iframe);window.console = iframe.contentWindow.console}())
重寫方法不讓更改
(function() { const originalConsoleLog = console.log; Object.defineProperty(console, 'log', { value: function() { originalConsoleLog.apply(console, arguments); }, writable: false, configurable: false }); // 測試輸出 console.log('Console.log has been secured.'); })();
凍結 Object.freeze(console)