switched bundle host field to url to retain http
This commit is contained in:
parent
7f36e99443
commit
2f1547a912
3 changed files with 12 additions and 13 deletions
|
|
@ -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>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>
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,10 @@ function createTab(entry) {
|
|||
|
||||
const title = document.createElement("span");
|
||||
title.className = "tab-title";
|
||||
title.textContent = entry.title || entry.host;
|
||||
title.textContent = entry.title || entry.url;
|
||||
tab.appendChild(title);
|
||||
|
||||
tab.title = entry.title || entry.host;
|
||||
tab.title = entry.title || entry.url;
|
||||
|
||||
// Click handler
|
||||
tab.addEventListener("click", () => {
|
||||
|
|
@ -93,11 +93,10 @@ function createTab(entry) {
|
|||
openInlineViewer(tab, entry, "/about.html");
|
||||
return;
|
||||
}
|
||||
const url = `${entry.protocol || "https"}://${entry.host}`;
|
||||
if (entry.iframe_ok) {
|
||||
openInlineViewer(tab, entry, url);
|
||||
openInlineViewer(tab, entry, entry.url);
|
||||
} 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
|
||||
if (container.children.length === 0) {
|
||||
const aboutEntry = {
|
||||
host: "everytab.site/about.html",
|
||||
url: "https://everytab.site/about.html",
|
||||
title: "About EveryTab",
|
||||
icon: "",
|
||||
iframe_ok: true,
|
||||
|
|
@ -241,14 +240,14 @@ function openInlineViewer(tabEl, entry, url) {
|
|||
|
||||
const title = document.createElement("span");
|
||||
title.className = "tab-title";
|
||||
title.textContent = entry.title || entry.host;
|
||||
title.textContent = entry.title || entry.url;
|
||||
header.appendChild(title);
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.target = "_blank";
|
||||
link.rel = "noopener";
|
||||
link.textContent = entry.host + " ↗";
|
||||
link.textContent = entry.url + " ↗";
|
||||
header.appendChild(link);
|
||||
|
||||
const close = document.createElement("button");
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
// BundleEntry is one tab in a bundle JSON file.
|
||||
type BundleEntry struct {
|
||||
Host string `json:"host"`
|
||||
URL string `json:"url"`
|
||||
Title string `json:"title"`
|
||||
Icon string `json:"icon"`
|
||||
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.
|
||||
func buildEntry(host HostRow, iconsDir string, logWriter *LogWriter, stats *Stats) BundleEntry {
|
||||
entry := BundleEntry{
|
||||
Host: host.Hostname,
|
||||
URL: host.Protocol + "://" + host.Hostname,
|
||||
Title: host.HtmlTitle,
|
||||
Icon: "",
|
||||
IframeOk: host.IframeAllowed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue