Stardance Addons
- 8 Devlogs
- 17 Total hours
✦ Make Stardance truly yours with unparalleled customization! ✦
✦ Make Stardance truly yours with unparalleled customization! ✦
I’ve finished building the foundation for the add-on system, like the toggle features, and for the first add-on, I added the ability to post Devlogs directly from the project page.
To make this happen, I added a new add-on API function that lets scripts run only when you’re on a path that meets certain criteria. It’s usually tricky to handle this in an SPA, but I found out that Turbo (the Rails framework Stardance uses) fires a turbo:render event on the document during page transitions, and that did the trick! It turned out super smooth, and I’m really happy with how it works :)
I had a really hard time with this, but I finally finished the feature that lets you post devlogs right from the popup. I initially tried using fetch, but it was tough because of Rails’ CSRF protection and Origin verification. So instead, I use the chrome.windows API to open a window for Stardance, then inject a script using the scripting API and content scripts to fill out and submit the form for the user. It’s pretty tricky, but I added a few touches to keep the UX smooth, like making it look like a loading screen in the middle of the popup. For example, to close the window right after posting, I save a specific value to sessionStorage first. Then, the content script checks for that value, sends a postMessage to the popup, and the popup catches it and calls the API to close the window. It makes the whole submission process feel seamless.
You can now check out Devlogs from the popup, and I’ve added a post form. I’ve also worked on stuff like skeleton loading and some fine-tuned handling.
But honestly, I just can’t get the Devlog submission to work right. I’ve been struggling with it for hours, but between the specific request requirements and Rails’ CSRF protection, nothing is clicking. I thought of a few tricky workarounds, but even those aren’t doing the trick. Part of the reason I’m posting this Devlog is actually to see if I can figure out the right way to handle these submission requests.
I’ve recreated the stardance postform experience, attachments included!
Working on popup page. You can post a Devlog immediately without even opening Stardance.
I continued working on the settings page, and also worked on how add-ons are handled in the codebase as well as the interface
I’m working on the UI for the settings page. There’s no logic yet. Also, I finished a cool-looking logo.
Inited an extension using WXT!
(I tried forking an existing one for another site and using Plasmo too, but this is what I’ve settled on for now).