Skip to content

Commit

Permalink
Fix settings UI blocking the screen on load; other minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
00Fjongl committed Jul 17, 2024
1 parent 7307bbb commit aed0911
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions proxyServiceValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ xx xx
const waitForDocument = new Promise(resolve => {
document.documentElement.appendChild(exampleIFrame);
exampleIFrame.addEventListener("load", () => {
result = exampleIFrame.contentWindow.document.title === website.title;
resolve();
result = exampleIFrame.contentWindow.document.title === website.title;
resolve();
});
});
});
exampleIFrame.src = url;
exampleIFrame.style.display = "none";
await waitForDocument;
Expand Down
8 changes: 7 additions & 1 deletion views/assets/css/styles-1644738239.css
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ details[open] summary {
}

.navbar .dropdown-settings {
display: none;
pointer-events: none;
position: fixed;
top: 0;
left: 0;
Expand All @@ -419,10 +421,10 @@ details[open] summary {
z-index: 5; /* Ensures it appears above other content */
align-items: center;
justify-content: center;
display: flex; /* Flexbox to center content */
}

.settings-content {
pointer-events: auto;
background-color: var(--nord0);
border: 1px solid var(--nord3);
border-radius: 10px;
Expand All @@ -432,6 +434,10 @@ details[open] summary {
text-align: center;
}

.dropdown-parent:focus-within .dropdown-settings {
display: flex; /* Flexbox to center content */
}

.dropdown-parent:focus-within .dropdown-child {
display: block;
}
Expand Down
4 changes: 2 additions & 2 deletions views/assets/js/register-sw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const stockSW = "/uv/sw.js";
const swAllowedHostnames = ["localhost", "127.0.0.1"];
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
const wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";

async function registerSW() {
if (!navigator.serviceWorker) {
Expand All @@ -13,13 +14,12 @@ async function registerSW() {
throw new Error("Your browser doesn't support service workers.");
}

let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
await connection.setTransport("/epoxy/index.mjs", [{ wisp: wispUrl }]);
await navigator.serviceWorker.register(stockSW);
}

async function setupTransportOnLoad() {
const conn = new BareMuxConnection("/baremux/worker.js");
const conn = new BareMux.BareMuxConnection("/baremux/worker.js");
if (await conn.getTransport() !== "/baremux/module.js") {
await conn.setTransport("/baremux/module.js", [{ wisp: wispUrl }]);
}
Expand Down

0 comments on commit aed0911

Please sign in to comment.