From 6566da2571cb3aa90655eafb35e46aed3382eb8f Mon Sep 17 00:00:00 2001 From: Reimar Date: Wed, 6 Aug 2025 18:30:19 +0200 Subject: [PATCH] Make back button detect if you have the page open in the background --- bookmark/index.html | 2 +- bookmark/script.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bookmark/index.html b/bookmark/index.html index 792fd06..7092542 100644 --- a/bookmark/index.html +++ b/bookmark/index.html @@ -20,7 +20,7 @@ to add this to your bookmarks.

Next time you open the bookmark, the will automatically be opened.

- Back   Open Popup Now + Back   Open Popup Now diff --git a/bookmark/script.js b/bookmark/script.js index 7f0053e..6f562ef 100644 --- a/bookmark/script.js +++ b/bookmark/script.js @@ -14,13 +14,18 @@ if (navigator.platform.match(/Mac/i)) { }); document.getElementById("open-popup").onclick = function() { - window.open( popupLink, "PopupTimer" + Date.now(), "width=250,height=100,menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=no" ); +} +document.getElementById("back").onclick = function() { + if (window.opener) + window.close(); + else + location.href = "/"; } function parseQueryParams() {