mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
remove windows phone debug scripts
This commit is contained in:
parent
f76b0ea06f
commit
d102abe425
23
index.html
23
index.html
@ -12,35 +12,12 @@
|
||||
</head>
|
||||
<body class="hydrogen">
|
||||
<script id="version" type="disabled">
|
||||
</script>
|
||||
<script id="phone-debug-pre" type="disabled">
|
||||
window.DEBUG = true;
|
||||
window.debugConsoleBuffer = "";
|
||||
console.error = (...params) => {
|
||||
const lastLines = "...\n" + window.debugConsoleBuffer.split("\n").slice(-10).join("\n");
|
||||
// window.debugConsoleBuffer = window.debugConsoleBuffer + "ERR " + params.join(" ") + "\n";
|
||||
// const location = new Error().stack.split("\n")[2];
|
||||
alert(params.join(" ") +"\n...\n" + lastLines);
|
||||
};
|
||||
console.log = console.info = console.warn = (...params) => {
|
||||
window.debugConsoleBuffer = window.debugConsoleBuffer + params.join(" ") + "\n";
|
||||
};
|
||||
window.HYDROGEN_VERSION = "%%VERSION%%";
|
||||
</script>
|
||||
<script id="main" type="module">
|
||||
import {main} from "./src/main.js";
|
||||
main(document.body);
|
||||
</script>
|
||||
<script id="phone-debug-post" type="disabled">
|
||||
setTimeout(() => {
|
||||
const showlogs = document.getElementById("showlogs");
|
||||
showlogs.addEventListener("click", () => {
|
||||
const lastLines = "...\n" + window.debugConsoleBuffer.split("\n").slice(-20).join("\n");
|
||||
alert(lastLines);
|
||||
}, true);
|
||||
showlogs.innerText = "Show last 20 log lines";
|
||||
}, 5000);
|
||||
</script>
|
||||
<script id="service-worker" type="disabled">
|
||||
if('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('sw.js')
|
||||
|
@ -90,8 +90,6 @@ async function buildHtml(version, bundleName) {
|
||||
doc("script#main").replaceWith(
|
||||
`<script type="text/javascript" src="${bundleName}"></script>` +
|
||||
`<script type="text/javascript">${PROJECT_ID}Bundle.main(document.body);</script>`);
|
||||
removeOrEnableScript(doc("script#phone-debug-pre"), debug);
|
||||
removeOrEnableScript(doc("script#phone-debug-post"), debug);
|
||||
removeOrEnableScript(doc("script#service-worker"), offline);
|
||||
|
||||
const versionScript = doc("script#version");
|
||||
|
Loading…
Reference in New Issue
Block a user