This commit is contained in:
lda committed 2025-12-18 03:08:14 +07:00
1 parent 5a1ae7f842
commit ebab37fc00
3 files changed
+27 -18

No files matched your search

+20 -12
View File
@@ -9,11 +9,12 @@
href="{{ url_for('static', path='style.css') }}"
/>
</head>
<body>
{% if queue_length > 0 %}
<div class="trail-container">
<div class="trail-count">{{ queue_length }}</div>
<p>Items Left</p>
<p>items left</p>
<p
style="
@@ -35,22 +36,29 @@
<div class="trail-hint">Tap anywhere to open & next</div>
</div>
<script>
if (window.opener) {
// new tab = window open no "noopener".
console.log(/** @type {Window} */ (window.opener)); // hi hello hi
}
window.addEventListener("load", () => {
document.body.addEventListener("click", async (e) => {
document.body.addEventListener("click", (e) => {
if (e.target.tagName === "A") return;
// now this is not the new updated
const newTab = window.open("", "_blank");
// do trix
await fetch("/r", { redirect: "manual" });
if (newTab) {
// background
if (newTab.document.body) {
newTab.document.body.style.backgroundColor =
getComputedStyle(document.body).backgroundColor;
}
// now this is the new updated
const newTab = window.open(window.location.href, "_blank");
// yo this is good no security error
window.location.replace("{{ current_link }}");
newTab.addEventListener("message", () => {
// Swap roles: Current tab -> Content, New tab -> Controller
location.replace("/r");
newTab.opener = null;
newTab.location.replace(window.location.href);
});
// Trigger the message event to run the swap on the next tick
newTab.postMessage("");
}
});
});
</script>