Lexical setbacks
Meta-blocked: Meta’s forms keep throwing me for a loop!
Looking after a baby the entire weekend is hard work, but now the little tyke is finally asleep, I can finally finish this week’s update!
After nights of watching the new Fallout series, I've decided to stop lazing around and tackle the Lexical challenge. For a quick recap: I'm trying to build a browser extension inspired by Type Slash AI, where you type “/ai” followed by a prompt in any text field, and the extension generates text based on the prompt. However, I faced a major roadblock with Meta sites like Facebook, Instagram, and WhatsApp: the AI-generated text wasn’t replacing the original prompt.
This happens because these sites use the Lexical.js package. It maintains a record of everything in the text fields. When I try to replace the text, Lexical notices and reverts it to the original. Even the 'tab' key, which I use to trigger the extension, is ignored.
So that was my week: trying to crack how to bypass a library meant specifically to prevent browser extensions from altering forms. ChatGPT didn’t help. Reddit didn’t help. Stackoverflow didn’t help.
I almost gave up a few times. But then I thought “No
! I bet Grammarly can do it! Surely there’s a way!”
Interestingly, even Grammarly struggles with Lexical editors. It currently works on Facebook, but not on Threads.net. The conclusion I got is that cracking Lexical is not enough: two implementations of the Lexical package may behave differently. Plus, I learned the Lexical team actively tweaks their code to ensure Grammarly works on their sites.
Given the complexity, it seems wiser not to support Meta’s sites. Maybe I can tackle this differently, who knows? But later! For now, let’s focus on the next crucial step: allowing users to add their API keys so I can release the extension. This will enable more people to use and benefit from it while I continue to explore solutions for those tricky text fields.
On the Unreal front
On the Unreal Engine front, I’m working on a Megaman clone with some free sprite assets. Currently learning how to implement Wall Jumping. And the secret is… Wall Sliding! This means that our character must:
Detect when they are touching a wall
Clamp the downward velocity when they fall while touching a wall
Allow the character to be launched from that wall towards the other side when that happens
To do #1, 2D games use a tactic called “line tracing”: an invisible line with a given length that shoots from our character and lets us know it overlaps with the object we are trying to detect. Similar to how a blind person would use a cane.
In the video, I made the line visible and longer so you can see what it looks like.
Cool eh?
Well, that’s for this week. Sorry for not having something complete to show. Maybe next week!

