VulpesOS/gaia/apps/email/js/console_hook.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

26 lines
745 B
JavaScript
Executable file

// when running in B2G, send output to the console, ANSI-style
/*global dump */
'use strict';
(function() {
function consoleHelper() {
var msg = arguments[0] + ':';
for (var i = 1; i < arguments.length; i++) {
msg += ' ' + arguments[i];
}
msg += '\x1b[0m\n';
dump(msg);
}
if ('mozTCPSocket' in window.navigator) {
window.console = {
log: consoleHelper.bind(null, '\x1b[32mLOG'),
error: consoleHelper.bind(null, '\x1b[31mERR'),
info: consoleHelper.bind(null, '\x1b[36mINF'),
warn: consoleHelper.bind(null, '\x1b[33mWAR')
};
}
window.onerror = function errHandler(msg, url, line) {
console.error('onerror reporting:', msg, '@', url, ':', line);
return false;
};
}());