[static] add shm_log js function available early in page load
This commit is contained in:
@ -4,3 +4,13 @@ function shm_cookie_set(name, value) {
|
|||||||
function shm_cookie_get(name) {
|
function shm_cookie_get(name) {
|
||||||
return Cookies.get(name);
|
return Cookies.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shm_log(...message) {
|
||||||
|
window.dispatchEvent(new CustomEvent("shm_log", {detail: {message: message}}));
|
||||||
|
}
|
||||||
|
window.addEventListener("shm_log", function (e) {
|
||||||
|
console.log(...e.detail.message);
|
||||||
|
});
|
||||||
|
window.addEventListener("error", function (e) {
|
||||||
|
shm_log("Window error:", e.error);
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user