kaka.farm

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/kaka.farm
Log | Files | Refs | README

commit 38a4ae74c13cb23bb1ce8b4f7c9f8bc8f89e3a55
parent 5cf6e3f6a42ece98ba1f24aece3b07a3efc4d10b
Author: Yuval Langer <yuvallangerontheroad@gmail.com>
Date:   Mon,  6 Jul 2020 15:07:20 +0300

Add no console on firefox android workaround.

Diffstat:
Ahtml/kakalog.js | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/html/kakalog.js b/html/kakalog.js @@ -0,0 +1,32 @@ +'use strict'; + + +console.log('kakalog.js start.'); + + +(function() { + function change_console() { + if (window.kakalog_activated) { + [ + 'log', + 'error', + 'info', + 'trace', + ].forEach(function_name=>{ + let old_function = console[function_name]; + let new_function = function(...stuff) { + old_function(...stuff); + let log_element = document.getElementById('log'); + let log_text = `${function_name}: ${stuff}`; + log_element.innerText = `${log_element.innerText}\n${log_text}`; + }; + console[function_name] = new_function; + }); + }; + }; + + window.addEventListener('load', change_console); +})(); + + +console.log('kakalog.js end.');