Skip to content

Commit

Permalink
address #76
Browse files Browse the repository at this point in the history
  • Loading branch information
Notplayingallday383 authored Oct 10, 2024
1 parent b3c535a commit 3b9873f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions static/hypertabs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@
<script src="../libcurl/index.js"></script>
<script src="../baremux/index.js" defer></script>
<script>
(async () => {
if ('serviceWorker' in navigator) {
await navigator.serviceWorker.register('/sw.js', {
scope: '/sw/',
}).then(async () => {
const connection = new BareMux.BareMuxConnection("/baremux/worker.js")
let transport = localStorage.getItem('transport') || "/epoxy/index.mjs"
// Feel free to remove this, its just for skids to stop making issues on it
if (window.location.origin.includes('.pages.dev')) {
console.log('your static hosting, using TOMP Wisp Server.')
let wispserver = "wss://tomp.app/wisp"
await connection.setTransport(transport, [{ wisp: wispserver }]);
} else {
console.log('Using Backend Wisp Server, if your static hosting just delete these lines bellow and uncomment out the text bellow')
//let wispserver = "wss://tomp.app/wisp" Uncomment if static hosting
let wispserver = `${window.location.origin.replace(/^https?:\/\//, 'ws://')}/wisp/`
await connection.setTransport(transport, [{ wisp: wispserver }]);
}
});
window.addEventListener("load", async () => {
if ('serviceWorker' in navigator) {
await navigator.serviceWorker.register('/sw.js', {
scope: '/sw/',
}).then(async () => {
const connection = new BareMux.BareMuxConnection("/baremux/worker.js")
let transport = localStorage.getItem('transport') || "/epoxy/index.mjs"
// Feel free to remove this, its just for skids to stop making issues on it
if (window.location.origin.includes('.pages.dev')) {
console.log('your static hosting, using TOMP Wisp Server.')
let wispserver = "wss://tomp.app/wisp"
await connection.setTransport(transport, [{ wisp: wispserver }]);
} else {
console.log('Using Backend Wisp Server, if your static hosting just delete these lines bellow and uncomment out the text bellow')
//let wispserver = "wss://tomp.app/wisp" Uncomment if static hosting
let wispserver = `${window.location.origin.replace(/^https?:\/\//, 'ws://')}/wisp/`
await connection.setTransport(transport, [{ wisp: wispserver }]);
}
});

await navigator.serviceWorker.register('/dynsw.js', {
scope: '/dyn/',
});
await navigator.serviceWorker.register('/dynsw.js', {
scope: '/dyn/',
});
}

if (!localStorage.getItem('HTfirstRun')) {
console.log('kongsole')
localStorage.setItem('HTfirstRun', false)
window.location.reload()
}
})();
})

// check custom functions
document.addEventListener('keydown', key => {
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script src="index.js" defer></script>
<script src="/js/tabs.js" defer></script>
<script>
(async () => {
window.addEventListener("load", async () => {
if ('serviceWorker' in navigator) {
await navigator.serviceWorker.register('/sw.js', {
scope: '/sw/',
Expand Down Expand Up @@ -45,7 +45,7 @@
localStorage.setItem('HTfirstRun', false)
window.location.reload()
}
})();
})
</script>
</head>
<body tabindex="-1" oncontextmenu="return false;" class="noSelect" id="no" data-notification="false">
Expand Down

0 comments on commit 3b9873f

Please sign in to comment.