This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/static_files/init.js

17 lines
474 B
JavaScript
Raw Normal View History

function shm_cookie_set(name, value) {
Cookies.set(name, value, {expires: 365, samesite: "lax", path: "/"});
}
function shm_cookie_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);
});