Spaces

I took over stewardship of the Spaces Chrome extension recently (open source repo). Dean, the original developer, no longer wanted to maintain it. Chrome Extension Manifest V3 had caused the extension to be broken for a couple years, and then eventually taken down from the Chrome Web Store. I have been a heavy daily user of this extension for over a decade.

Ok, he wants to sell me on this "Spaces" thing now...

beer

A "Space" is just a named browser window with a set of tabs, for example "Beers to Brew". Now that you've given the Space a name, if you don't immediately need it, just close the browser window and let those beer recipe tabs go, man. Your RAM and CPU will thank you for it. Later, when you want to decide which recipe to brew, reopen the space, and all those tabs magically re-appear. Yep, it's kind of like bookmarks in folders, but better because Spaces automatically remembers as you add/remove tabs from the window.

And in case you're curious, Tab Groups don't quite work for me, I context switch at work so much that I eventually end up with many many Spaces, like 100+. In fact, I still don't know why browsers don't just do what Spaces does by default, but maybe there are fewer people like me with hundreds of tabs open at a time.

Once you get over that hump of closing the window and trusting the extension to do its job you will go from a person who might have hundreds of tabs open to maybe only 20-30 at a time.

tools

Anyway, since I've never written a browser extension before, I thought I'd use it as an opportunity to also pair program with an AI Agent and learn things that way. GitHub offered me Copilot to me for free, and I found Claude Sonnet 4 pretty capable, so I went for it. For some tasks, I'd occasionally swap out the LLM model (Gemini, GPT) and with other tasks I'd use Gemini Code Assist and Gemini CLI. It's good to understand the "personalities" of the models and to try out other agent user interfaces so that you can see where the game changes are.

My experience with this so far has been best described as "working with a variety of eager interns who needs a lot of guidance", matching a lot of other experiences I've read about. Is it saving me time? - oh yes indeed. I mean it's not a total obvious win, but for things like creating unit test suites and things of that nature it's great. Maybe a 2x improvement in velocity? Just be prepared to type at it a lot and to exercise your patience if you're particular.

gift

If you're turning your nose up at this point, I'd suggest you think about the opportunity here. Take advantage of the enormous amounts of free compute that big corporations are laying at your fingertips to move faster and build more, bro. The window of free compute is closing fast.

§1429 · September 18, 2025 · Agentic, Chrome, JavaScript, Open Source, Software, Technology, Tips · (No comments) ·


dice

Once upon a time, I ported a turn-based strategy / tactical combat game to the web. The average play time for the game is quite long (many hours), so saving games is an important feature.

PC/Console games have two ways to do "game saves":

  1. Save on the machine, keyed to the user thanks to the operating system's file system and
  2. Save on the cloud, keyed to the user by some identity provider.

1) is easy to implement (writing and reading a file to disk). 2) is much harder to implement, costs money to run, and requires the gaming machine to have network connectivity.

Web games can do 2) just as easily as PC games. Since this is a hobby project with near-zero players, I don't plan to build my own Cloud service, and I don't trust any Cloud-hosted "gaming" API to be stable enough or not get killed in the future. So that leaves me with saving and loading games locally.

Unfortunately, browsers have a major road block: they do not allow native file system access. Back a decade ago when I started to write the game, it looked to me like browsers would eventually implement this: progress on browser compatibility and "native app" capabilities were pretty breathtaking at that time.

So I put up with some jankiness: To load a savegame, pick a file from your computer. To save a game, the web app downloads the savegame file to your computer. That kind of sucks and doesn't allow a save-as-you-play experience, but good enough for now. I threw in more jank with the option to use Google Drive API as well for a cheap-o version of a Cloud service. (Why not Play Games API? Because they eventually killed their Web API. See "stable forever" above.)

All this jank was an acceptable workaround until browsers caught up, or so I thought.

dice

Here we are a decade later. Though Chrome desktop has proposed and implemented the File System Access API for native file access, it's not quite enough when compared to what native apps can do - and other browser vendors have adamantly refused to implement true native file access, making this capability a sad bloated corpse floating in a lake. I'm saying native file access is dead in the water.

Why didn't I just use localStorage or IndexedDb for this? Well, for one, it was stubbornness and naïvety. For two, I worried about how much data I could store reliably. For three, I thought that users would expect their saved games in Chrome to be playable in Firefox or Safari on the same machine or want ways of passing their saved games around.

The fact my savegames are something like 35k means that storage was never really a concern.

The fact that most users only ever use a single browser, means I don't need to really worry that much about portability.

It's actually pretty straightforward to implement a virtual file system in IndexedDb that works good enough. Heck, Apple did it as some weird peace offering to people who wanted File System Access. [As an aside: as far as I can tell, an origin-private file system offers zero user-facing benefits over IndexedDb, you're just trading one API for another... so it's a devex offering. True native file access offers user benefits, such as backing up your save games, hacking, modding, sharing outside of the browser]

So in the end, I just wrote my own storage service that loads/saves games to an IndexedDB store in the browser. These days, superior user experience trumps web specification idealism for me every time.

apple

P.S. I'm no security expert. I'm sure Mozilla and Apple have good reasons for rejecting the File System Access API. I'm just sitting here loving the technology of the web (zero install, the APIs, JavaScript/Typescript) and the developer experience but wishing I had all the perks that native apps do.

P.P.S. I was surprised to learn that an IndexedDB instance for a page at foo.net is different than the IndexedDB instance of an iframe of foo.net hosted at bar.net. That's a subtlety I hadn't thought through.

§1394 · April 19, 2024 · Apple, Entertainment, Firefox, Games, Google, Software, Technology, Web · (No comments) ·


JavaScript

Oh, remember that time six years ago when I said one day soon we'll be able to use ES Modules everywhere, even inside Web Workers and Service Workers? Well that day is next week when the last browser ships support for ES Modules in Workers - finally!

Yes, I know that ES Modules are terrible, actually - but the fact is that they are the future of JavaScript / TypeScript / Node / Deno development so we all might as well accept it. I actually think they're great. I've been using them for hobby projects forever - though I rarely use transpilers, bundlers, etc.

Celebrate

Sure, it will be some time before CommonJS modules are resigned to the ash heap of history, until then https://esm.sh/#docs can help... but I for one welcome our Isomorphic JavaScript overlords.

§1350 · May 31, 2023 · JavaScript, Software, Technology, Web · Comments Off on All We Need is Just a Little Patience ·


Logo for JSON

I decided to learn a bit of React again for some toy projects (my day job JS framework is Angular). Most of the tutorials for setting up a React project "from scratch" ultimately result in using the create-react-app library to hide a lot of the complexity (transpilers, bundlers), but I'm not interested in Webpack or Babel - primarily because I know browsers don't need them anymore. Also, I like to learn about how the bits and bobs work together for small projects like this. Here are the 3 things I want: Typescript, JSX, and compile/deploy to ES modules. Can this actually be done? Yes, and it's not that difficult.

Read the rest of this entry ...
§1318 · April 8, 2023 · JavaScript, React, Software, Technology, Web · Comments Off on Dead Simple: TSX, ES Modules, Preact ·


Logo for JSON

The elder days of my blog are littered with useless musings on XML and JSON. So why not throw another one on the pile? 🙂

I wish JSON supported:

  1. Multi-line strings (but no string interpolation)
  2. Trailing commas (in arrays and object property lists)
  3. Comments

Of course none of these will probably ever happen, but having any of these three would keep JSON wonderfully simple but vastly improve the user experience of those who have to hand-tweak JSON files (which is a lot of people!). I kept these feature requests to only things supported by ECMAScript itself. I also note that several parsers seem to accept JSON with #2 and #3.

YAML has all these, but of course it has many other features that, I assume, make it burdensome to write a fully compliant parser.

[Update Jan 2023: I finally filed a bug on VS Code for this idea of back-ticked string support in their tasks.json. Maybe it's crazy, I haven't decided... but feel free to vote it up!]

§1306 · October 26, 2022 · JavaScript, Software, Technology · Comments Off on 3 Wishes for JSON · Tags: , ,