@ywkrlerche/richardwho 1.0.42 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.js CHANGED
@@ -836,6 +836,8 @@
836
836
  // Newest first. Add an entry here with every publish; its version should match package.json.
837
837
  // Each has: new (features), games (added/removed/fixed games), fixes (bugs). Leave a list out if empty.
838
838
  const CHANGELOG = [
839
+ { version: "1.0.43", date: "2026-11-10",
840
+ new: [], fixes: ["The .svg version now shows your tab disguise (like Google Classroom) in the browser tab", "In the .svg version, the link back to the normal site is at the bottom of the Games page and opens its Games page"] },
839
841
  { version: "1.0.42", date: "2026-11-10",
840
842
  new: ["The site also opens as an .svg link, for places where the normal link is blocked: find it on the home page and the Games page"], fixes: [] },
841
843
  { version: "1.0.41", date: "2026-11-03",
@@ -1112,10 +1114,12 @@
1112
1114
  $("bookmark-link").href = VIA_SVG ? SVG_URL : LATEST_URL;
1113
1115
  for (const id of ["alt-link-home", "alt-link-games"]) {
1114
1116
  const a = $(id);
1115
- a.href = VIA_SVG ? LATEST_URL : SVG_URL;
1117
+ a.href = VIA_SVG ? LATEST_URL + (id === "alt-link-games" ? "#games" : "") : SVG_URL;
1116
1118
  a.textContent = VIA_SVG ? "🔗 Normal link" : "🔗 NEW VERSION OF SITE";
1117
1119
  a.title = VIA_SVG ? "Open the regular version of the site" : "Open the site as an .svg, for when the normal link is blocked";
1118
1120
  }
1121
+ // in the .svg version the Games page's link sits at the bottom of the page instead of the header
1122
+ if (VIA_SVG && $("alt-link-games").parentElement !== $("games-foot")) $("games-foot").appendChild($("alt-link-games"));
1119
1123
  $("bookmark-name").textContent = "richardwho";
1120
1124
  $("bookmark-icon").src = REAL_ICON;
1121
1125
  }
package/index.html CHANGED
@@ -173,6 +173,7 @@
173
173
  <div class="grid" id="grid"></div>
174
174
  <p class="empty" id="empty" hidden>No games match that search. <button class="text-btn link" type="button" id="request-btn-2">Request it</button></p>
175
175
  </section>
176
+ <p class="games-foot" id="games-foot"></p>
176
177
  </section>
177
178
 
178
179
  <!-- TRIVIA: a quick quiz (questions from Open Trivia Database) plus links to daily puzzle sites -->
package/index.svg CHANGED
@@ -1,10 +1,11 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
2
- <title>Richards Unblocked Games</title>
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" width="100%" height="100%">
2
+ <title id="tab-title">Google Classroom</title>
3
+ <html:link id="tab-icon" rel="icon" href="https://ssl.gstatic.com/classroom/favicon.png"/>
3
4
  <!--
4
- jsDelivr serves .html as text/plain (shown as raw code) but serves .svg as image/svg+xml,
5
- which browsers open as a real document that can run scripts. This launcher fetches
6
- index.html from the same folder, points its relative links (style.css, app.js, games.json)
7
- back at jsDelivr with a <base> tag, and shows it full-screen in an iframe.
5
+ jsDelivr/unpkg serve .svg as image/svg+xml, which browsers open as a real document that can run scripts.
6
+ This launcher fetches index.html from the same folder, points its relative links (style.css, app.js,
7
+ games.json) back here with a <base> tag, and shows it full-screen in an iframe. The browser tab shows
8
+ this file's title and icon, so they're copied from the site inside (the tab disguise from Settings).
8
9
  -->
9
10
  <style><![CDATA[
10
11
  html, body, svg { margin: 0; padding: 0; width: 100%; height: 100%; background: #0b0d14; overflow: hidden; }
@@ -19,6 +20,24 @@
19
20
  </foreignObject>
20
21
  <script><![CDATA[
21
22
  (async () => {
23
+ const titleEl = document.getElementById("tab-title");
24
+ let iconEl = document.getElementById("tab-icon");
25
+ const setTab = (title, icon) => {
26
+ if (title && titleEl.textContent !== title) titleEl.textContent = title;
27
+ if (icon && iconEl.getAttribute("href") !== icon) {
28
+ // a fresh element makes the browser pick up the new icon
29
+ const fresh = iconEl.cloneNode();
30
+ fresh.setAttribute("href", icon);
31
+ iconEl.replaceWith(fresh);
32
+ iconEl = fresh;
33
+ }
34
+ };
35
+ // the saved disguise, right away (the site saves it as tabTitle / tabIcon)
36
+ try {
37
+ const s = JSON.parse(localStorage.getItem("rug-settings") || "{}");
38
+ setTab(s.tabTitle || (s.disguise === "off" ? "Richards Unblocked Games" : null), s.tabIcon);
39
+ } catch (e) {}
40
+
22
41
  const base = location.href.replace(/[?#].*$/, "").replace(/[^/]*$/, "");
23
42
  const msg = document.getElementById("msg");
24
43
  try {
@@ -27,7 +46,7 @@
27
46
  let html = await res.text();
28
47
  html = html.replace(/<head([^>]*)>/i, '<head$1><base href="' + base + '">');
29
48
  const frame = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
30
- frame.setAttribute("allow", "fullscreen; autoplay; gamepad; pointer-lock");
49
+ frame.setAttribute("allow", "fullscreen; autoplay; gamepad; pointer-lock; camera; microphone");
31
50
  frame.setAttribute("allowfullscreen", "");
32
51
  document.getElementById("root").appendChild(frame);
33
52
  // Write the page into a blank frame so it keeps this real https:// address (games need it)
@@ -37,6 +56,13 @@
37
56
  doc.close();
38
57
  msg.remove();
39
58
  frame.contentWindow.focus();
59
+ // keep the tab's name and icon in step with the site (disguise changes, game names)
60
+ setInterval(() => {
61
+ try {
62
+ const d = frame.contentDocument, icon = d.getElementById("tab-icon");
63
+ setTab(d.title, icon && icon.href);
64
+ } catch (e) {}
65
+ }, 500);
40
66
  } catch (err) {
41
67
  msg.textContent = "Couldn't load the site (" + err.message + "). Try refreshing.";
42
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ywkrlerche/richardwho",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "Richards Unblocked Games",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
package/style.css CHANGED
@@ -1052,3 +1052,5 @@ html.fest[data-theme="dark"] .festive { display: block; }
1052
1052
  /* ---------- Link to the other version of the site (.svg / normal) ---------- */
1053
1053
  .alt-link { text-decoration: none; color: inherit; }
1054
1054
  #view-games .games-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
1055
+ .games-foot { display: flex; justify-content: center; margin: 28px 0 8px; }
1056
+ .games-foot:empty { display: none; }