Skip to content

Commit ea61d1c

Browse files
detect codespaces
1 parent 501b0df commit ea61d1c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

js/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ if (location.host.indexOf('localhost') != -1) {
470470
document.title += ' - localhost version';
471471
$('main .heading').textContent += ' - localhost version';
472472
}
473+
else if (location.host.indexOf('.github.dev') != -1) {
474+
document.title += ' - codespace version';
475+
$('main .heading').textContent += ' - codespace version';
476+
}
473477
else if (location.protocol.indexOf('file') != -1) {
474478
document.title += ' - file:// version';
475479
$('main .heading').textContent += ' - file:// version (some features unavailable)';

serviceWorker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const CACHE_NAME = "langton-music-v2";
22

3-
if (location.protocol.indexOf('file') === -1 && location.host.indexOf('localhost') === -1) {
3+
if (location.protocol.indexOf('file') === -1 && location.host.indexOf('localhost') === -1 && location.host.indexOf('.github.dev') === -1) {
44

55
// Copied from https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate
66
self.addEventListener('fetch', e => {

0 commit comments

Comments
 (0)