When I search for code for a “custom context menu”, I get code for how to recreate a context menu with HTML elements, but that's not really what I want. The simple solutions forget about the context menu needing to move left when the mouse is too far right, needing to flip up when the mouse is too low, etc.. Trying to manually implement these is bound to be error-prone, so I'm looking for the most braindead way to handle all of that. The browser's native context menus handle all of that already, so I want to hijack those with my own options and event handlers.
I see this question, where the answer seems to be “no”. However, that question is over 16 years old, and one person mentioned that Firefox did have a browser-specific API for it. Given that it's 2026, is there now a cross-browser way to do this in JavaScript? If not, is there a solution which is similarly simple?