switched bundle host field to url to retain http

This commit is contained in:
Joe Lothan 2026-05-19 23:38:14 -04:00
parent 7f36e99443
commit 2f1547a912
3 changed files with 12 additions and 13 deletions

View file

@ -32,11 +32,11 @@
<p>The data comes from <a href="https://commoncrawl.org">Common Crawl</a>, a free, open archive of the web. Every month, we process the latest crawl, extract website titles, download the favicons, and bundle it up into the site you see here.</p> <p>The data comes from <a href="https://commoncrawl.org">Common Crawl</a>, a free, open archive of the web. Every month, we process the latest crawl, extract website titles, download the favicons, and bundle it up into the site you see here.</p>
<p>Click on a tab to visit the site and scroll down for more tabs.</p> <p>Click on a tab to visit the site and scroll down for more tabs. Some sites do not allow embedding so clicking them will open a new tab (in your browser) instead.</p>
<p>Note that some sites do not allow embedding and will open a new tab instead. Also note that just like the web itself, some sites are broken, not suitable for work, trying to harvest your data, serving malware, or an affront to humanity itself.</p> <p>Note that, just like the web itself, some sites are broken, profane, fake news, pornographic, trying to harvest your data, serving malware, or an affront to humanity itself. But some of them are pretty cool too.</p>
<p>EveryTab just shows a random slice of the Web, in all its messy and beautiful glory.</p> <p>EveryTab just shows a random slice of the web, in all its messy and beautiful glory.</p>
<p>Enjoy!</p> <p>Enjoy!</p>

View file

@ -82,10 +82,10 @@ function createTab(entry) {
const title = document.createElement("span"); const title = document.createElement("span");
title.className = "tab-title"; title.className = "tab-title";
title.textContent = entry.title || entry.host; title.textContent = entry.title || entry.url;
tab.appendChild(title); tab.appendChild(title);
tab.title = entry.title || entry.host; tab.title = entry.title || entry.url;
// Click handler // Click handler
tab.addEventListener("click", () => { tab.addEventListener("click", () => {
@ -93,11 +93,10 @@ function createTab(entry) {
openInlineViewer(tab, entry, "/about.html"); openInlineViewer(tab, entry, "/about.html");
return; return;
} }
const url = `${entry.protocol || "https"}://${entry.host}`;
if (entry.iframe_ok) { if (entry.iframe_ok) {
openInlineViewer(tab, entry, url); openInlineViewer(tab, entry, entry.url);
} else { } else {
window.open(url, "_blank", "noopener"); window.open(entry.url, "_blank", "noopener");
} }
}); });
@ -163,7 +162,7 @@ async function loadMore() {
// Inject the "About EveryTab" tab at a random position in the first load // Inject the "About EveryTab" tab at a random position in the first load
if (container.children.length === 0) { if (container.children.length === 0) {
const aboutEntry = { const aboutEntry = {
host: "everytab.site/about.html", url: "https://everytab.site/about.html",
title: "About EveryTab", title: "About EveryTab",
icon: "", icon: "",
iframe_ok: true, iframe_ok: true,
@ -241,14 +240,14 @@ function openInlineViewer(tabEl, entry, url) {
const title = document.createElement("span"); const title = document.createElement("span");
title.className = "tab-title"; title.className = "tab-title";
title.textContent = entry.title || entry.host; title.textContent = entry.title || entry.url;
header.appendChild(title); header.appendChild(title);
const link = document.createElement("a"); const link = document.createElement("a");
link.href = url; link.href = url;
link.target = "_blank"; link.target = "_blank";
link.rel = "noopener"; link.rel = "noopener";
link.textContent = entry.host + " ↗"; link.textContent = entry.url + " ↗";
header.appendChild(link); header.appendChild(link);
const close = document.createElement("button"); const close = document.createElement("button");

View file

@ -9,7 +9,7 @@ import (
// BundleEntry is one tab in a bundle JSON file. // BundleEntry is one tab in a bundle JSON file.
type BundleEntry struct { type BundleEntry struct {
Host string `json:"host"` URL string `json:"url"`
Title string `json:"title"` Title string `json:"title"`
Icon string `json:"icon"` Icon string `json:"icon"`
IconW int `json:"icon_w,omitempty"` IconW int `json:"icon_w,omitempty"`
@ -25,7 +25,7 @@ type Bundle struct {
// buildEntry creates a BundleEntry for a host, converting its icon if available. // buildEntry creates a BundleEntry for a host, converting its icon if available.
func buildEntry(host HostRow, iconsDir string, logWriter *LogWriter, stats *Stats) BundleEntry { func buildEntry(host HostRow, iconsDir string, logWriter *LogWriter, stats *Stats) BundleEntry {
entry := BundleEntry{ entry := BundleEntry{
Host: host.Hostname, URL: host.Protocol + "://" + host.Hostname,
Title: host.HtmlTitle, Title: host.HtmlTitle,
Icon: "", Icon: "",
IframeOk: host.IframeAllowed, IframeOk: host.IframeAllowed,