Mothers of Invention

I might be movin’ to Montana soon
Just to raise me up a crop of
Dental Floss

–Frank Zappa, “Montana”
A screenshot of Google Chrome showing the extension that I made in the toolbar.

This is completely ridiculous. But there it is.

I like to read a bit in bed before nodding off. I know, you’re supposed to put tech away, but I do put it in “night mode” and I don’t do too much, and it does really help me unwind. Sometimes I read an actual book, but sometimes I don’t want to deal with the weight of it. Anyway, sometimes I find something and think to myself, “I want to see more about this later” (or maybe “I need to see this on a bigger screen” or even “I need to see this when I’m more awake”) and finding that in Chrome on iOS I could easily add something to my “reading list”, well that’s just perfect. I used to use Pocket for that a lot, but what I found is that I’d put something there and then never look at it again because it was out of the way. The Chrome reading list, though, is right there in Chrome, so it should be a lot easier to see it and remember!

Except, well, it’s not. See I’d add something, and then some days later I might open a tab on my phone and there’s a little “1” on the “Reading List” shortcut button on the phone. Then I’d think, “didn’t I save that like a week ago?” Maybe I’d look at it again, but still come to the same conclusion – I need to look at this from my desktop, so I’ll just leave it there. Then next time I sit at my desk, there’s nothing to indicate that something is waiting for me, and I’d continue to forget about it.

I went looking last weekend for a solution. I figured there had to be a way to put a little number on the desktop Chrome application to say “you’ve got three things waiting here to be read.” But as it turns out, there isn’t. You can add the reading list icon to the toolbar so you can click a single thing and have it show up, but there’s no indicator there as to how much stuff is sitting on it. So I looked online, and couldn’t find anything either. And then I did something I didn’t think I would do: I asked ChatGPT.

AI is a real hot-button topic anymore. And I see many sides to the issue. I’m friends with artists who rightfully point out the ways in which large language models and AI systems do things that harm both their art, their trademarks and intellectual property, and their livelihoods. And I agree that’s something that is a huge problem. I see people talk about the amount of power that is used to train the models, and run things through them, and I know they’re not wrong – my job is alongside HPC systems and I see the amount of energy and compute power that goes into various things that sometimes are used to run LLMs and other trainings. But, I also see things like AlphaFold which have advanced some aspects of computational biology, and so when I see sweeping statements like “BAN ALL AI!” or people saying “DON’T USE AI!” I cringe because I see the good it can do as well. Of course the bad things need to be figured out. But didn’t people say the internal combustion engine was a horrible idea because of what it would do to horses? Maybe that’s a bad comparison, I don’t know.. I’m not a philosopher, I’m a tinkerer. I’ll leave the philosophy and bigger topics to others to figure out the details and stick to the stuff I definitely know better… so let me get back to tinkering, and tell you about what I did.

I started by asking ChatGPT if what I wanted to do already existed. It confirmed what I had already found, that it didn’t exist today, but gave me five ideas: Use a bookmarks folder and an extension to watch it, use a tab management extension and save tabs that way, save such links in Google Keep or Tasks and use an extension on the desktop to monitor them, use an experimental feature flag that might do the trick, or write my own extension to do what I wanted. The first two options I dismissed right away because they ignore the reading list entirely and use something else, and I didn’t want to do that. The third I dismissed because I already use Google Keep for other things and wouldn’t want to have to change my use of it for this idea. And the fourth I’d already looked into, and found that the flag mentioned is apparently only available on Android devices to show a badge for them and wouldn’t work on the desktop anyway. So I replied that making an extension is an interesting idea, but I don’t even know what the language is so let me hear more about it.

Chrome extensions are written in a combination of JavaScript and HTML, with some CSS thrown in for formatting if needed. Well, I’m not terribly familiar with JavaScript but I’ve done a little bit, and my background in computer science helps me “grok” a language even if I haven’t seen much of it before, so when ChatGPT asked me if I wanted to try building an extension I said sure. It then gave me the basics I needed – create a directory, create these files with these contents, and how to load it into Chrome in developer mode. I looked over the files and it was basically going to make a simple toolbar icon with a static number on it as a test; everything made sense to me, so I went ahead with it. When I got an error I came back and described the error and was told the way to fix it – every error in this process was one ChatGPT made, not me, which was interesting, but it was also interesting that it was able to fix them when they were pointed out. When that worked, I was presented with some ideas on how to make the number indicative of the actual number of items on the list, but again it diverged into trying things like counting the number of bookmarks in a folder which would mean doing things differently.

When it first told me about the idea of making an extension and then started giving some other information, I looked and found an API call that seemed like it might work to interact with the reading list. However, ChatGPT said that API wouldn’t be available to me because it was internal or experimental, and that an extension that used it would never make it to the Chrome web store (which honestly, at that point, wasn’t even something I was thinking about). Well, wondering if it might work anyway, I modified the JavaScript to reference that API and it worked. So I told ChatGPT the good news, and it ran off to make another update that would actually do what I needed. Well, it tried to, but again the code it gave me was wrong – for one thing, the call itself was to the wrong method, and it needed an argument that I didn’t provide. Since I don’t know much about the language I didn’t catch the second error though I did account for the first, and came back with another update. Again I was given something that should work, and this time it did. Rather than just saying “that works” I directed the conversation, namely I didn’t want an HTML page to pop up when I click the button but instead to open the reading list itself. Again ChatGPT told me that may not be possible and the reasons why, but I pushed; even if it’s going to give me an error, I’d like to see that error and how it fails, at the very least to learn more about how this works. So please give me the code that you think will fail and let me see it fail. It did, and interestingly I didn’t see the failure – because there was another thing I needed to change, which it had also forgotten.

I’m now seeing a trend here. There’s a lot of information and utility I’m getting out of this, but it’s by no means a way to simply say “I want this thing” and have it come to being. If you don’t know anything about programming, you might hack through it with a few more iterations than I used; a few times I could tell what wasn’t working and nudged things in the right direction, for example, and having read the API documentation I had a feeling it was wrong about the one API being unpublished and unusable. But on the other hand, I walked into this transaction with no idea how to make an extension, and I already know a lot more about it than I did when I began. So it’s not a replacement for programming knowledge, but it definitely helped me learn something new in this case.

I went through a few more iterations of things – asking if the built-in icon was available somehow, or if I had to get it from the source, and deciding to get my own instead; adding other watchers to update the count when things were added or removed from the list; removing the default pop-up that was created early on so that clicking could trigger some other action – and then asked how I go about publishing it, because why not at this point? I was given most of what I needed to get started, and went to create my developer access. Uploaded the extension information, added some screenshots, and clicked submit. The page said it could take a week or two in order to be published, but just two days later it was in the store and ready, my aptly named “Reading List Counter“. So if you want a silly icon to sit in your toolbar to remind you that you need to look at the reading list, there you go. I’m probably going to change a few things since this first iteration is extremely basic, like maybe have the color change when it’s not zero (or be missing when it is), and I need to add a hook to change the icon depending on if it’s in light or dark mode because I realized the following morning that it disappears when Chrome switches to light mode. Whoops.

So that was my day on Sunday. Kinda productive all things considered, because I learned a few new things: 1, building a Chrome extension isn’t terribly difficult if you want to do it; and 2, ChatGPT can be a lot of fun, and a very useful tool. It shouldn’t be relied upon for everything, and as it even says itself the output should be checked for validity. And of course there exists all the reasons why various LLMs and forms of AI are bad for .. well, everything. But I don’t think it should all be thrown out. We need to figure out what the answer is, but I don’t think banning it is the right one, nor is shunning those who use it. Some times you might get good information out of it, and if you’re careful about how you’re doing things you may come away from it better than you arrived, and that’s not a bad thing. By all means, tell me your thoughts on it, just try not to be polar – it’s neither the end of all civilization, nor the answer to all of life’s problems.

Leave a Reply

Your email address will not be published. Required fields are marked *