Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<!-- favicon.ico for Safari before 26 (no SVG favicons), the SVG for the
others. "?v=2": a new address, so browsers fetch the icons afresh
instead of a cached older one - raise it when the logo changes. -->
<link rel="icon" href="/favicon.ico?v=2" sizes="32x32" />
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png?v=2" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>glpython</title>
<script src="/coi-serviceworker.js"></script>
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
18 changes: 18 additions & 0 deletions scripts/check-ide-browser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,24 @@ try {
await context.close()
})

await check('icons: favicon.ico, favicon.svg, apple-touch-icon, each ?v=2 (P41)', async () => {
const context = await newContext()
const page = await open(context, base)
assert.deepEqual(await page.evaluate(() => [...document.querySelectorAll('link[rel~="icon"], link[rel="apple-touch-icon"]')].map((link) => [link.rel, link.getAttribute('href'), link.type, link.getAttribute('sizes')])), [
['icon', '/favicon.ico?v=2', '', '32x32'],
['icon', '/favicon.svg?v=2', 'image/svg+xml', null],
['apple-touch-icon', '/apple-touch-icon.png?v=2', '', null],
])
// Through the page, i.e. through the service worker: served, with the query, as images.
const served = await page.evaluate(async () => Promise.all(['/favicon.ico?v=2', '/favicon.svg?v=2', '/apple-touch-icon.png?v=2'].map(async (path) => {
const response = await fetch(path)
return [path, response.status, response.headers.get('content-type')?.split(';')[0], (await response.arrayBuffer()).byteLength > 0]
})))
assert.deepEqual(served.map(([path, status, , filled]) => [path, status, filled]), [['/favicon.ico?v=2', 200, true], ['/favicon.svg?v=2', 200, true], ['/apple-touch-icon.png?v=2', 200, true]])
assert.ok(served.every(([, , type]) => /^image\//.test(type)), `as images: ${served.map(([, , type]) => type).join(', ')}`)
await context.close()
})

await check('⋮ «Info»: the version from version.json, and the update check', async () => {
const { version } = JSON.parse(readFileSync(new URL('../dist/version.json', import.meta.url), 'utf8'))
const context = await newContext()
Expand Down
Loading