mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-12 11:30:01 -04:00
Fix settings UI blocking the screen on load; other minor changes
This commit is contained in:
parent
7307bbbd84
commit
aed0911e70
3 changed files with 12 additions and 6 deletions
|
@ -235,10 +235,10 @@ xx xx
|
||||||
const waitForDocument = new Promise(resolve => {
|
const waitForDocument = new Promise(resolve => {
|
||||||
document.documentElement.appendChild(exampleIFrame);
|
document.documentElement.appendChild(exampleIFrame);
|
||||||
exampleIFrame.addEventListener("load", () => {
|
exampleIFrame.addEventListener("load", () => {
|
||||||
result = exampleIFrame.contentWindow.document.title === website.title;
|
result = exampleIFrame.contentWindow.document.title === website.title;
|
||||||
resolve();
|
resolve();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
exampleIFrame.src = url;
|
exampleIFrame.src = url;
|
||||||
exampleIFrame.style.display = "none";
|
exampleIFrame.style.display = "none";
|
||||||
await waitForDocument;
|
await waitForDocument;
|
||||||
|
|
|
@ -409,6 +409,8 @@ details[open] summary {
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .dropdown-settings {
|
.navbar .dropdown-settings {
|
||||||
|
display: none;
|
||||||
|
pointer-events: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -419,10 +421,10 @@ details[open] summary {
|
||||||
z-index: 5; /* Ensures it appears above other content */
|
z-index: 5; /* Ensures it appears above other content */
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
display: flex; /* Flexbox to center content */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-content {
|
.settings-content {
|
||||||
|
pointer-events: auto;
|
||||||
background-color: var(--nord0);
|
background-color: var(--nord0);
|
||||||
border: 1px solid var(--nord3);
|
border: 1px solid var(--nord3);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
@ -432,6 +434,10 @@ details[open] summary {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-parent:focus-within .dropdown-settings {
|
||||||
|
display: flex; /* Flexbox to center content */
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown-parent:focus-within .dropdown-child {
|
.dropdown-parent:focus-within .dropdown-child {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const stockSW = "/uv/sw.js";
|
const stockSW = "/uv/sw.js";
|
||||||
const swAllowedHostnames = ["localhost", "127.0.0.1"];
|
const swAllowedHostnames = ["localhost", "127.0.0.1"];
|
||||||
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
|
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
|
||||||
|
const wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
|
||||||
|
|
||||||
async function registerSW() {
|
async function registerSW() {
|
||||||
if (!navigator.serviceWorker) {
|
if (!navigator.serviceWorker) {
|
||||||
|
@ -13,13 +14,12 @@ async function registerSW() {
|
||||||
throw new Error("Your browser doesn't support service workers.");
|
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 connection.setTransport("/epoxy/index.mjs", [{ wisp: wispUrl }]);
|
||||||
await navigator.serviceWorker.register(stockSW);
|
await navigator.serviceWorker.register(stockSW);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setupTransportOnLoad() {
|
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") {
|
if (await conn.getTransport() !== "/baremux/module.js") {
|
||||||
await conn.setTransport("/baremux/module.js", [{ wisp: wispUrl }]);
|
await conn.setTransport("/baremux/module.js", [{ wisp: wispUrl }]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue