You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

2h 14m 16s logged

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.

0
5

Comments 0

No comments yet. Be the first!